Your code doesn't make any sense. Care to comment on what it means?
Guido didn't do us any favors with his migration strategy, but Python 3.4 is a substantially better and more modern language, so I would suggest developing on it (it's supported out of the box on Ubuntu 14.04 LTS, for example). It's true that app platform providers have not caught up yet, though.
Can you provide more details? The one thing that python3 did well is actually fixing the unicode/str mixup.
You posted some lines of code, but didn't tell exactly what's wrong with it.
> Python3 not operating on bytes by default is a mess
Why not just use the b'' prefix then and be explicit?
> can't move to Python3 due to how unicode is implemented
I'd like to see the bugs he raised against python 3 regarding this. There should be no difference in what you can and cannot do using python 2/3. I don't want to call BS on this, but... please provide some specific issues if you're claiming py3 is not usable.
I'm not arguing that it's not, but I don't how your examples support your point. Would you please explain how your examples show that "strings are unicode" is broken on Python 3?
FWIW, here's what I get:
Python 2:
>>> import sys, locale
>>> print(sys.getdefaultencoding())
ascii
>>> print(locale.getpreferredencoding())
UTF-8
>>> print(sys.stdout.encoding)
UTF-8
>>> print(sys.getfilesystemencoding())
utf-8
In Python 3, the only difference is: >>> print(sys.getdefaultencoding())
utf-8Is he running Python in, say, a Command Prompt window that's maintaining compatibility with a Russian-localized version of MS-DOS?
I can see how he can't move to Python 3, because Unicode support in his environment is basically impossible. That's a deeper problem than just Python. If he's been writing Python 2 code that deals with Russian text, it's probably producing mojibake when run on any machine but his own!
Not to mention the unicode implementation is broken. I was just talking to a Russian user (someone you'd assume would want unicode by default), and Python3 not operating on bytes by default is a mess. He can't move to Python3 due to how unicode is implemented.
print sys.getdefaultencoding() # ascii
print locale.getpreferredencoding() # cp1251
print sys.stdout.encoding # cp866
print sys.getfilesystemencoding() # mbcs
#~ print u"кодировочка!"
#~ print u"кодировочка!".encode('cp866')
#~ print unicode(u"кодировочка!", 'cp1251')
#~ os.rename ('b', u'б')
In most things in life, you'd always want the 'latest version', it would be a no-brainer. I wouldn't even bet on the transition to Python3 succeeding until it has- it's been 6 1/2 years already.
Use 2.7 and then move to 3.x when and if it ever makes sense. It won't be hard at all to switch as a user, that's not the problem.