5 ms·
This seems exciting. I'm not familiar with the availability of new Python features. When can I use this in my day to day Python?
by wcdolphin 11y ago
This seems exciting. I'm not familiar with the availability of new Python features. When can I use this in my day to day Python?
- pas 11y agohttps://github.com/JukkaL/mypy https://github.com/JukkaL/mypy is the/one implementation of a static checker that conforms to PEP 484. (Naturally, as far as I know, JukkaL with mypy almost singlehandedly inspired the PEP.)
- IshKebab 11y agoI guess this will be in Python 3, so probably never! :P
- Nemcue 11y agoYou can use it today if you want to, there is already language support for adding your own type notation. And if you don't want to create your own you could use https://pypi.python.org/pypi/obiwan https://pypi.python.org/pypi/obiwan
- tveita 11y agoSimple function annotations like def foo(x: int) -> str: ... have been available since 3.0, and editors like PyCharm already use them for typechecking. For new PEP 0484 features like generics, MyPy supports Python 3.2 and up, but PyCharm support seems to be work in progress: https://youtrack.jetbrains.com/issue/PY-15206 https://youtrack.jetbrains.com/issue/PY-15206