6 ms·
There's a patch from pytype that backported the type annotation syntax from python3 to python27: https://github.com/google/pytype/blob/master/pytype/patches/pyt
by yegle 9y ago
There's a patch from pytype that backported the type annotation syntax from python3 to python27: https://github.com/google/pytype/blob/master/pytype/patches/python_2_7_type_annotations.diff https://github.com/google/pytype/blob/master/pytype/patches/...
- sametmax 9y agoYou don't really need it, Python 2.7 can already use type comments.
- luch 9y ago(author here) by type comments your mean this : https://www.python.org/dev/peps/pep-0484/#type-comments https://www.python.org/dev/peps/pep-0484/#type-comments ? I haven't seen them used anywhere, but that's an okay solution I guess. NB : by the way, love your blog :p
- carapace 9y agoI was experimenting with them a little while ago, along with MyPy [1] but I immediately ran into an issue where the type system couldn't describe the type I was using, so I had to let it go (reluctantly.) [1] http://mypy-lang.org/ http://mypy-lang.org/
- sametmax 9y agoSame. Mypy was very limited at the beginning, and have been much more improved since. I give it a try regularly. It is indeed way better now, although I'm still structural typing and taking duck typing in consideration.
- sametmax 9y agoYep. Works great. Less convenient than regular type hints, but when you need a transition tool, it's nice. > NB : by the way, love your blog :p Thanks :)
- jnwatson 9y agoThat requires everybody that uses my module to use a patched interpreter. Type comments work fine. Also, that doesn't help those of us stuck on Python 3.4, the last version that supports Windows XP (don't ask).