Re:Python 3 is killing Python
by teddyh on Thursday August 14, 2014 @08:06AM
(#8177046)
OK, no. Most modules/libraries are ported to Python 3. The minor ones that aren’t are those that are dead upstream, and you shouldn’t be using them, and/or they should be easy to port yourself.
I really think the real reason is that people, especially English-speaking, but others, too, have been sticking their collective heads in the sand about this ASCII/Unicode situation for far too long. If, on the other hand, you started to use Unicode strings as soon as possible in Python 2, your Python 3 “port” could be two additional lines:
if sys.version_info.major == 2:
str = unicode
Oh yeah, the future_builtins module does not exist anymore (for obvious reasons), so its import needs to be wrapped in a try-except clause:
try:
from future_builtins import *
except ImportError:
pass
So call it five additional lines. That it literally all the porting I had to do to make two Python 2 programs completely runnable in Python 3 and Python 2, unaltered.
The problem is not Python 3. The problem is people using byte strings and Python 2’s implicit conversions of them without actually understanding what a string is.
I really think the real reason is that people, especially English-speaking, but others, too, have been sticking their collective heads in the sand about this ASCII/Unicode situation for far too long. If, on the other hand, you started to use Unicode strings as soon as possible in Python 2, your Python 3 “port” could be two additional lines:
Oh yeah, the future_builtins module does not exist anymore (for obvious reasons), so its import needs to be wrapped in a try-except clause: So call it five additional lines. That it literally all the porting I had to do to make two Python 2 programs completely runnable in Python 3 and Python 2, unaltered.The problem is not Python 3. The problem is people using byte strings and Python 2’s implicit conversions of them without actually understanding what a string is.