3 ms·
First off. Python 2.6 and 2.7 supported Unicode just fine. I had a large all-Unicode system in Python 2.6. You had to write u'word" to get a Unicode constant,
by Animats 7y ago
First off. Python 2.6 and 2.7 supported Unicode just fine. I had a large all-Unicode system in Python 2.6. You had to write u'word" to get a Unicode constant, and use a "unicode(s)" function here and there. Also, the part that remained "compatible" was that "str" remained an array of bytes, even though there was also a type "bytes" and a "bytearray".
Early Python 3 was hell for conversion. The syntax was changed for no good reason. u'word" became illegal. (That later went back in.) The "2 to 3 converter" was a joke. I didn't have the "print statement problem" because my code called a logging function for all debug output.
Many of the P3 libraries didn't work. (The all-Python MySQL connector failed the first time I tried to do a bulk load bigger than a megabyte, indicating that nobody was using it.) It took years before the libraries were cleaned up.
Python 3 got some really weird features, such as type declarations that don't do anything. I can see having type declarations, especially for parameters, but they need to be used both for checking and optimization. CPython boxes everything, which is terrible for numerics and is why most serious math has to be done in C libraries. My comment on that was "Stop him before he kills again."
- wnissen 7y agoThey still did stuff that makes no sense, to me, like not supporting `iteritems` on dictionaries and `xrange` on sequences. Or using `str` to mean bytes? That would have been possible to make backwards compatible until Python 4. At this point, does anyone think there will be a Python 4?
- kevin_thibedeau 7y agoYou're expected to clean that stuff up with 2to3. The whole idea is to not leave band-aids in place.
- viraptor 7y ago> Python 2.6 and 2.7 supported Unicode just fine It did, but in a way that chainsaws support sculpting just fine. Technically possible. Very advanced people will know how to handle it. Everybody else is just going to injure themselves randomly. Most people writing py2 got the text/binary processing working on accident. Things appear to work until you throw actual Unicode into parameters and then nobody knows what happens. There's a number of "what does this decoding exception mean" questions on stackoverflow every day. They're often actual bugs people could ignore before. Now they're told immediately and I believe that's better.
- fireattack 7y agoCan vouch that as an amateur Python user from a country using "non-ASCII" language, py2 is a pain in ass when I was learning the language. It didn't help that Py2's IDLE had (have? I didn't recall they actually resolved this, simply closed the issue) a major bug [1] that even if you explicitly use u-literals (a = u'日本語'), it will still be encoded in your locale (shift_JIS [2] in Japanese case), instead of unicode/utf-8. You can imagine how confused people would get when they were testing unicode support of py2 in IDLE and saw this. [1] https://bugs.python.org/issue15809 https://bugs.python.org/issue15809 [2] https://en.wikipedia.org/wiki/Shift_JIS https://en.wikipedia.org/wiki/Shift_JIS
- Izkata 7y ago> Now they're told immediately Or so you wish, it's not necessarily true though. It's just as likely to pass through gibberish without blowing up. I have a tiny relay service written in Django that lets me pass messages between my phone and home computer, that I recently upgraded both the python and Django version. The service is only two views of about 3 lines each - and a unicode conversion bug crept in such that it stored "b'text'" in the database instead of "text". No warnings, no errors.
- user5994461 7y agoPictures of chainsaw sculptures for reference: https://www.google.com/search?q=chainsaw+sculptures&tbm=isch https://www.google.com/search?q=chainsaw+sculptures&tbm=isch Some are quite good and finely detailed in my opinion. It's really nothing like what you'd expect after hearing chainsaw. There actually are small chainsaw, maybe even one-handed ones, to do that.
- jeltz 7y agoI think ice sculpting on the other hand is usually done with a normal sized chainsaw.
- kevin_thibedeau 7y ago"Just fine" fails as soon as someone does isinstance(foo, str) in 2.x. If foo was a unicode object, well it sucks to be you. There are a lot of footguns in the old string handling. Python 3's fail fast approach ensures they get caught early on.
- jimbob45 7y agoOTOH, Python screwed up so badly that modern languages now know not to call a redesign a sequel, so it's not all gloom and doom.