6 ms·
What motivated the Python devs to abandon backwards compatibility with Python 3? I don't see any major departures or revolutionary new features transitioning fr
by joefourier 6y ago
What motivated the Python devs to abandon backwards compatibility with Python 3? I don't see any major departures or revolutionary new features transitioning from 2 to 3. While there's certainly upgrades (e.g. strings), there's enough small changes that upgrading to 3 is rarely a pleasant experience.
- macintux 6y agohttps://snarky.ca/why-python-3-exists/ https://snarky.ca/why-python-3-exists/
- harikb 6y agoWhat that article casually ignores is the fact that there could have been a Python 2 fix (as Python 3) that took the approach of fixing encoding to utf8 only. If that was the only thing Python 3 vs 2 was breaking, life could have been so much better.
- mixmastamyk 6y agoThe go approach was not well known at the time, maybe would have worked. Water under the bridge.
- downerending 6y agoSummarizing, that article says "we fixed Unicode". Well, guess what? Unicode in Python3 is a catastrophe. The truth is that Python3, as a new language incompatible with Python2, was a mistake. I'm sure it was well intended, but here we are.
- joshuamorton 6y agoWhat's wrong with it?
- downerending 6y agoConsider this, for example: https://click.palletsprojects.com/en/7.x/python3/ https://click.palletsprojects.com/en/7.x/python3/ and here, have a nice sandwich of this: https://stackoverflow.com/questions/57652720/runtimeerror-click-will-abort-further-execution-because-python-3-was-configured https://stackoverflow.com/questions/57652720/runtimeerror-cl... or this bullshit: https://bugzilla.redhat.com/show_bug.cgi?id=1404918 https://bugzilla.redhat.com/show_bug.cgi?id=1404918 The truth no one wants to hear is that Python2 did Unicode right (or as well as could be expected), while Python3 is a train wreck, even if you just stick to LANG=C and ASCII.
- joshuamorton 6y agoThe surrogate escape issue was fixed in 3.7 and you shouldn't use LANG=C as a locale, you should use LANG=utf-8. Python doesn't have bad unicode handling, the system does when you set LANG=C. And no, for people who actually have to use unicode, python2 didn't do unicode anything like "right". Python2 did unicode "right" for the people with LANG=C and ASCII. Those people are generally wrong. Even pallets notes >Misconfigured environments can currently cause a wide range of Unicode problems The keyword there is misconfigured. Your system is misconfigured. Fix it (by making your locale correct). Then the problems go away.
- downerending 6y agoSo, I was right to scorn 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, and 3.6? And no, LANG=C isn't wrong. Your software has one job, to at least be correct for LANG=C. If it can't do that, it sucks.
- joshuamorton 6y agoLang=C is broken if you have non-ascii unicode filenames (or many other things, but those are the most obvious). That's not pythons fault, it's your bad encoding. Python trusts the system, and the system lies. It's your fault for lying to python. Configure your system correctly, don't lie to your tools and then blame them. Lang=C is the realm of English only 70s crap programs. You shouldn't use it. Use a modern encoding that supports modern characters.
- winddude 6y agoSome time technical debt needs to be eliminated. Keep backward compatability would have meant keeping technical debt. Breaking changes are fine.
- TylerE 6y agoThe core problem is they didn't break ENOUGH. Thus Python3 failed (and frequently, continues to fail) to be a compelling upgrade to anyone but unicode purity fetishists.
- reedwolf 6y ago>>Thus Python3 failed (and frequently, continues to fail) to be a compelling upgrade to anyone but unicode purity fetishists Huh? No new project of any note is using 2. Everyone has either upgraded to 3 or never even learned 2 to begin with.
- TylerE 6y agoIncorrect. There is tons of Python2 code being maintained, added to, and working diligently in production.
- kamyarg 6y agoI am not a "unicode purity fetishists" and python 3 has been a compelling upgrade for me for the past 3 years. I have not written single line of python 2 code since 2 years ago. So your statement that it is not compelling for anyone is wrong. Maybe some people are python 2 fetishists? I have upgraded multiple python 2 codebases to 3 and I am not understanding what people are whining about, it is not rocket science. This is something people are getting paid to do; maintain their codebase and keep it up-to-date.
- nuclear_eclipse 6y agoBecause no one could ever be justified in moving to Python 3 for AsyncIO, f-strings, ordered dictionaries, assignment expressions, pathlib, new features in shutil/tempfile/subprocess/etc, along with massive improvements to memory consumption, runtime performance, and overall stablility?
- mixmastamyk 6y agoNone of our projects had any trouble, rarely is an overstatement. Only if the project was huge and dealt heavily with string/bytes was it a problem. Everything else could be fixed mechanically.