Hacker News new | past | comments | ask | show | jobs | submit login
Planning an Early Death for Python 2 (carreau.github.io)
6 points by ngoldbaum on Sept 26, 2015 | hide | past | web | favorite | 4 comments

"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.

"did not permit to re-raise exception"


    >>> try:
    ...   1/0
    ... except ZeroDivisionError:
    ...   print "oops!"
    ...   raise
    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.

There'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

Many 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.

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