Planning an Early Death for Python 2
carreau.github.io
carreau.github.io
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.
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.
* 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
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.