2 ms·
I think some are valid criticisms, but not valid enough to throw your toys out of the pram. > Not In Your Best Interests I say what's in my best interest and
by viraptor 10y ago
I think some are valid criticisms, but not valid enough to throw your toys out of the pram.
> Not In Your Best Interests
I say what's in my best interest and py3 fixed a lot of issues for me. I'm happy with the upgrade and dropped py2 for new projects this year.
> No Working Translator
A flawless translator is simply not possible. 2to3 is the best effort idea. At some point you'll run into `def f(x): return x[0]` and without doing a full program static analysis you won't be able to say what's the right translation. You have to do it manually where needed.
> Difficult To Use Strings
I understand that the py2's "just works" strings are easier. But at the same time, having a non-ascii name I know that most applications "just work" simply because nobody actually tested them outside of ascii set. Py3 doesn't explode on encoding for fun - it basically says: you made an assumption that kind of worked so far by accident, but now you need to say explicitly what you want to do. I think it's a good thing, even if it takes people time to adjust.
> Core Libraries Not Updated
I don't even know what he means. This really needs an example, or it's just a meaningless rant.
> Purposefully Crippled 2to3 Translator
As above. Some things are just not possible to translate without knowing what the programmer meant. Some things in py2 strings happened to work a bit "by accident" and simply won't work in py3 for good reasons. For example py2 code:
In [1]: "abc".encode('ascii').encode('ascii')
Out[1]: 'abc'
It may look silly on one line, but there's lots of applications that relied on py2's "it just works" strings - and this what was effectively run at some point in the code logic.