Hacker News new | past | comments | ask | show | jobs | submit | ilevkivskyi's comments login

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.


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" :-)


> C++, Perl and Haskell have operator overloading and it gets abused something rotten to produce "concise" (a.k.a. line noise) code.

That's fairly funny coming from a discussion about a language that overloads '+' for strings and numerics, and overloads ==/!= similarly. Perl uses '.' for string concatenation and '+' for numeric addition, and uses eq/ne for string equality, and ==/!= for numeric equality. There's a reason for that.

Overloading is not necessarily used that often in Perl. It's a module that's part of the core, but it's fairly clunky and I rarely see it in the wild except for that spots that it really makes sense (DateTime object boolean comparison comes to mind).


It is also interesting to read the discussion on reddit http://redd.it/376bi1


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.


Matrix multiplication sounds good


See also acceptance letter https://mail.python.org/pipermail/python-dev/2015-May/140104... and the discussion on Reddit http://redd.it/36yuk8


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: