HNHacker News
TopNewBestAskShowJobs

ilevkivskyi

156 karma · joined May 23, 2015

submissionscomments
ilevkivskyi··on Ask HN: Anyone using Python's static typing in a large project?
Dropbox and Instagram use mypy/typing actively. Also among open-source: https://github.com/home-assistant/home-assistant https://github.com/mitmproxy/mitmproxy https://github.com/sphinx-doc/sphinx

I would say the opposite, it is not very useful for small projects.

ilevkivskyi··on PEP 0484 – Type Hints is accepted
From the acceptance letter: """ if you are worried that this will make Python ugly and turn it into some sort of inferior Java, then I share you concerns, but I would like to remind you of another potential ugliness; operator overloading.

C++, Perl and Haskell have operator overloading and it gets abused something rotten to produce "concise" (a.k.a. line noise) code. Python also has operator overloading and it is used sensibly, as it should be. Why? It's a cultural issue; readability matters.

Python is your language, please use type-hints responsibly :) """ I would add metaclasses, generators, etc. all these are already enough to write horrible things. It is indeed all about "culture", readability is really the cornerstone of Python culture. Type hints when used responsibly are fantastic tool. You could be surprised but they really improve readability, it's like a succinct docstring. I discovered this while recently reading through one large codebase. Moreover, typechecker will tell you when your "docs" do not reflect actual semantics. Finally, I would like to point out that typing.py and Mypy are pure Python, no magic :-) At the same time "import typing" is very in the spirit of "import antigravity". I hope Python gradual typing could become alternative to Java/C++/etc. BDSM-style typing and one day we could say: "Come join us! Typing is fun again" :-)

ilevkivskyi··on Python 3.5 beta 1 released
It is also interesting to read the discussion on reddit http://redd.it/376bi1
ilevkivskyi··on Python 3.5 beta 1 released
It looks like 3.5 will be a great release: async/await syntax, type hinting, matrix multiplication etc. I hope more people will switch to Python 3, since nothing of this will be backported to Python 2.
ilevkivskyi··on PEP 0484 – Type Hints is accepted
See also acceptance letter https://mail.python.org/pipermail/python-dev/2015-May/140104... and the discussion on Reddit http://redd.it/36yuk8