3 ms·
The first point can be rather easily circumvented by using strings as forward references and it only takes a bit of googling to figure that out. The second does
by davesque 7y ago
The first point can be rather easily circumvented by using strings as forward references and it only takes a bit of googling to figure that out. The second doesn't seem remotely like a deal breaker to me. Half the reason for having type annotations is to provide a description of what a function or method does at a glance. This is idiomatic even in hardcore functional languages like Haskell. With return type inference, you don't get that benefit.
- cjwoodall 7y agoIt seems to me that type inference would be silly in this case. Type suggestion during mypy checks might be useful though. Function x does not specify a type, but returns SomeHelpfulTypeString. We recommend you use that. Put it behind a flag and call it a day. Maybe even have a way of requesting type suggestions for functions during development