3 ms·
What did Python remove?
by kstrauser 8y ago
What did Python remove?
- jrockway 8y agoMany things. The linked document notes that the print statement of Python 2 was removed from Python 3, harming migration.
- ianamartin 8y agoThe print statement to function didn't hurt migration. Nor did any of the other actual changes. What hurt the migration is a small but loud group of Python developers who think everything in the language was just fine, that not only was Python 3 unnecessary, it was actively bad and signaled a bunch of know-it-all theoretical type people from other languages coming in and taking over their own little corner of the wild west and imposing law and order where it wasn't asked for. Actually, even those people aren't what hobbled the Python migration. What made it such a mess was that the core team didn't tell that crowd to fuck right off and get with the program or get left behind. And even now with 2.7 nearing end of life, those same grumpy curmudgeons hang around web forums and reddit and blogs here and there, giving new people bad advice, complaining about how much better the old days were before unicode and async and types. I even saw someone griping about those new-fangled decorators and how monkeypatching was better. The thing that made a mess out of the transition was the core team trying too hard to coax people who didn't want to move into coming along with them with a small bucket of carrots and no sticks. They tried to pull the bandaid off slowly and it took too long and still hurt like hell.
- kstrauser 8y agoI couldn't agree more. There was a huge amount of wailing that, for instance, Python 3 suddenly made devs care about the difference between text and bytes, when Python 2 had let them happily write broken code without complaining. Yes, you have to write correct code now. Yes, this requires changing some stuff. But yes, this is better for everyone in the (not so) long run.
- orangecat 8y agoThe Python 3 transition has taken 10+ years and millions of developer-hours. It is perfectly reasonable to question whether the benefits have been worth the costs, especially when compared to other platforms like JavaScript that have made much greater advancements during that time.
- hathawsh 8y agoSee the release notes of Python 3.0: https://docs.python.org/3.0/whatsnew/3.0.html#removed-syntax https://docs.python.org/3.0/whatsnew/3.0.html#removed-syntax The removals were actually an easier pill to swallow than the numerous subtle changes in behavior introduced by the big, deep switch to Unicode. I'm over it now, but that was painful!
- rraval 8y agoThis is my attempt to be sympathetic to the GP's point of view, perhaps they have a different example in mind. One example comes from the new-style / old-style classes distinction and the method resolution order when considering multiple inheritance. Python 2.3 introduced "new-style" classes which inherit from `object` and use the C3 resolution algorithm [1]. For backwards compatibility reasons, "old-style" classes without an explicit `object` base class still used the old method resolution semantics. Python 3 does away with "old-style" classes entirely and all classes must use the "new-style" semantics. There's presumably a ton of code that doesn't specify `object` as an explicit base class, and thus may have subtle broken behaviour under "new-style". Given Python 3's inability / unwillingness to simulate the old behaviour, I'm unaware of any tool that's able to rewrite Python 2 to 3 in a bullet proof fashion [2]. This is not the same kind of breakage that other people mention, like `print` being a function or `reduce` being moved to `functools`. Those are simply backwards incompatible "movements", not outright removals, and thus can be rewritten by automated tools. [1] https://www.python.org/download/releases/2.3/mro/ https://www.python.org/download/releases/2.3/mro/ [2] https://portingguide.readthedocs.io/en/latest/classes.html#new-style-classes https://portingguide.readthedocs.io/en/latest/classes.html#n...
- yammajr 8y agomaybe not removed, but they certainly did make breaking changes to the language. here are some of the most obvious python 2: print "foo" # foo 3 / 5 # 0 apply # <built-in function apply> python 3: print "foo" # SyntaxError: Missing parentheses in call to 'print' 3 / 5 # 0.6 apply # NameError: name 'apply' is not defined
- stcredzero 8y agoThese are precisely the kind of changes one would make to a language if you wanted to cause as much pain as possible. (I say this as someone who has been paid to write a syntax-driven code rewriting tool to go from one language version to another.)
- shaklee3 8y agoBut at the same time, f-strings are soooo much better than the old way, or even .format().
- bobbyi_settv 8y agoFor one, it removed the ability to do % formatting with bytes objects. When working with a wire protocol like ssh, you need to work with sequences of bytes, not Unicode strings, and porting code that assembled them using % formatting was a huge pain; I tried and failed to port paramiko to python 3.
- minitech 8y agoYou might already be aware, but %-formatting with bytes is back as of 3.5.