3 ms·
I wish PEP 484 put more thought into backward compatibility with Python2. Currently you need to import things like Callable, Tuple and these don't exist in Pyt
by jbritton 10y ago
I wish PEP 484 put more thought into backward compatibility with Python2.
Currently you need to import things like Callable, Tuple and these don't exist in Python2. It is especially odd since I am using MyPy comment syntax, so MyPy needs import statements even when all types are inside comments.
I like the way Haskell puts type information above the definition.
- price 10y agoIn Python 2 and also in Python 3.4 and earlier, you get Callable, Tuple, and the rest from the `typing` module on PyPI: https://pypi.python.org/pypi/typing https://pypi.python.org/pypi/typing This is a direct backport of the same `typing` module that's in the stdlib starting in Python 3.5. (I'm one of the mypy core developers and work at Dropbox. We're using PEP 484 and mypy on a lot of Python 2 code!)