4 ms·
Planning an Early Death for Python 2
- Avernar 11y ago"it did not protect you from mixing Unicode and bytes" I don't need any protection. All my data is UTF-8 so having to convert back and forth to the frankenstien 1, 2, 4 byte "unicode" type is waste of time, memory (space and bandwith) and just adds complexity. So I will not be moving to Python 3 by choice. To me Python is Python 2. If there is no Python 4 by 2020 with proper UTF-8 support I'll just switch to another language.
- dalke 11y ago"did not permit to re-raise exception" BS. >>> try: ... 1/0 ... except ZeroDivisionError: ... print "oops!" ... raise ... oops! Traceback (most recent call last): File "<stdin>", line 2, in <module> ZeroDivisionError: integer division or modulo by zero "did not allow you to replace the printing function" More BS. from __future__ import print_function Poof! Now I can replace the printing function. "had a range object which is not memory efficient" And a range object called 'xrange' which is memory efficient.
- GFK_of_xmaspast 11y agoThere's a lot of not-actually-true statements in there, sibling posts got a couple but also: * tripped you with integer division <-- I always thought (and still think) that integer division should return integers, not promote to float * had a range object which is not memory efficient <-- just use xrange
- dalke 11y agoMany people agree with you about division. Many more disagree. There were long discussions about the merits. One of the reasons for having 1/2 == 0.5 is that user testing of relatively new programmers showed that many a mistake. My own experience working with computational chemists (who are relatively new programmers) confirms that. I myself has an experienced program also make that mistake, so nowadays always use the future directive to get float division.