|
|
|
|
|
by vidarh
170 days ago
|
|
That's true, but it can also add unnecessary constraints if done thoughtlessly. E.g. if you require an input to be StringIO, instead of requiring an object that responds to "read". Too often I see people add typing (be it with a project like this, or with is_a? or respond_to?) that makes assumptions about how the caller will want to use it, rather than state actual requirements. That is why I prefer projects to be very deliberate and cautious about how they use types, and keep it to a minimum. |
|