3 ms·
> unless you have static type definitions for these methods you start having a very bad time inferring what types are being passed around. It doesn't matter if
by valenterry 4y ago
> unless you have static type definitions for these methods you start having a very bad time inferring what types are being passed around.
It doesn't matter if the types are annotated explicitly or inferred. The amount of information is 100% the same. The IDE could just fill in the types _exactly_ in the same way as they would look like when annotated by hand - maybe just with a different color.
IntelliJ does this quite well, see for instance: https://i.stack.imgur.com/tiqjc.png https://i.stack.imgur.com/tiqjc.png
This is not a guess. This is the real types. There is literally no difference in the behaviour/semantics of the code.
> Consider typical python wrapper library with liberal
No, because python is not statically typed. You can't compare that.
- dllthomas 4y ago> It doesn't matter if the types are annotated explicitly or inferred. The amount of information is 100% the same. Explicit offers the opportunity for narrowing, comments, and sometimes choice of names. Otherwise, yes.
- valenterry 4y agoGood points!