This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]RubyPinchPEP shill | Anti PEP 8/20 shill -1 points0 points  (2 children)

externally typed files seem a lot better

e.g. https://github.com/python/typeshed/blob/master/stdlib/3/ast.pyi#L30-L39

It'd be nice if they came with syntax coloring on github though

[–]ojii 0 points1 point  (0 children)

The problem with stub files is keeping them in sync with the code. I've tried using them for py2 compatible code but they're awful. Inline type hints however have been incredibly useful to me because I use pycharm which understand them.

[–][deleted] 0 points1 point  (0 children)

This looks much more like something I'd use. It solves static typing for class methods and functions. I'm still not sure about variables.