5 ms·
A bit off-topic, but I'm really curious. Why do people not upgrade Python and stick with 2.7?
by marcus_holmes 8y ago
A bit off-topic, but I'm really curious. Why do people not upgrade Python and stick with 2.7?
- JimmyAustin 8y agoPython 3 had massive breaking changes, especially in the way it handles the string <-> byte conversion at the edge of the application. It's very easy to write a Python 2 application that works on ASCII and fails as soon as someone inserts umlauts, and very hard for Python 3.
- Fradow 8y agoA few reasons: - libs not available for Python 3 (this is a big problem for some people) - codebase work and don't need/want any evolution Python 3 provide - fear of Python 3 being unstable (that was legitimate during the first few Python 3 versions, not that much anymore) There are probably more.
- tom_ 8y agoBecause python is there to work for me, not the other way round... Once they actually, truly, genuinely really do properly drop support for python 2.7, maybe I'll be forced into doing something about it.
- ekianjo 8y agoOutdated codebases that still work fine and would require lots of efforts to update?
- acqq 8y agoBecause not all computers that are target of my code are under my control. I apparently have users who simply per policy don’t upgrade often. There are many use cases where “install then just do security updates” is really the best solution. These computers still can need new Python scripts. Even Python 2.4. I’ve just adapted some scripts for that. It’s still pity that Python 3 isn’t more adjusted to that fact.
- cpburns2009 8y agoI have a Python 2.7 code base that has to be supported on an outdated Ubuntu instance which only supports up to Python 3.2. I really should upgrade to a newer version of Python 3. However, that requires replacing that instance which is overdue but not a small undertaking.
- kstrauser 8y agoAlternatively, use something like pyenv to install whatever version you want. OS X ships with 2.7.10, but darned if I use that for anything at all.
- PurpleRamen 8y agoIt's stable, it works, and porting thousends to millions lines of code is cumbersome if you have also real work waiting for you.. Additionally, Python3 is only really usable for the more professional audiance since 2-3 years ago. Before that they were busy with stabilizing Python3, porting popular libs, portling less popular libs, or creating replacements for dead libs.
- dwheeler 8y agoA lot of the problem is that originally the developers of Python made it absurdly difficult to transition from Python 2 to Python 3, and thus the costs far exceeded the benefits. It was historically difficult to write code that ran in both Python 2 and Python 3. If you wanted to transition to Python 3, you had to simultaneously transition every file in your program, every library you depended on, and all libraries they depended on transitively, to Python 3. The "2to3" program was supposed to automate, but this never worked reliably, and cannot work reliably - to do that reliably requires type information that is typically unavailable in Python. Things have gotten much better, thankfully. Python 3 (and 2) have been tweaked over the years to make it much easier to write code that will work on both Python 2 and 3, and to make it easier to tweak existing code so that it will work on both. As a result, it's possible to transition code a file at a time, or even a portion at a time, instead of the impossible "all at once" transition. Almost no one used Python 3 after it was released, or for a number of years later. Now that the developers of Python have started to make transition practical, people have started transitioning. Still, it takes real effort to transition to Python 3, and many people have "real work" to do instead of transitioning language versions without any real benefit. "3 is larger than 2" is not a real benefit. A real benefit is something like "this transition will radically increase performance" - and no one is claiming that Python 3 has a real-world advantage like that over Python 2. "Python 2 will eventually be unsupported" is a problem, but no one is providing free money to do the transition, so for many people it's just a fact. Historically Python has been very good about supporting backwards compatibility and smooth upgrades. I hope that the Python 2->3 transition was an anomaly. You can make changes to languages, but you have to make it easy for users to do the transition.
- deleted 8y ago[deleted]
- KODeKarnage 8y agoHere's a killer feature of Python 3: if the GIL is ever removed, it will be from Python 3 and unlikely to ever reach Python 2.
- carapace 8y agoWell, speaking only for myself, if I think of Python 3 as a separate language from Python 2 (which it surely is by now) and ask myself as a sober, grounded, (wannabe) engineer "what do I gain from (re-)writing my code in Python 3?", I gotta say the benefits just aren't there. There's nothing technically compelling in Python 3. It's all developer candy. Python 2 is going to remain stable for years, even decades. It's FORTRAN. Development on the C interpreter will stall, but what that really means is that it will become asymptotically bug-free. If no one is touching the code except to apply bug-fixes there are no sources of new bugs (okay bug-fixes will introduce bugs themselves, but the net trend will be negative.) Even if you have to use e.g. Tauthon (a Python 2 that brings in a few select features from 3) you can still expect a more stable environment than Python 3 development. And there are a lot of Python 2 runtimes and other places where Python 2 syntax is still welcome: Stackless, Pypy, Cython, Nuitka, MicroPython, Brython, etc... Python 2 hasn't gone anywhere. Frankly, I think it's a damn shame IMHO that the Python 3 interpreter can't run Python 2 code! Not even with a command line switch. It should be able to switch syntax per module/file at least. Anyway, to repeat, to me Python 3 is full of dubious toys for developers but has no compelling business value to drive adoption. It's cannibalizing the Python 2 community and ecosystem, but without that nobody would use it. It's not better than 2, just different. If you were to start a new project and had to decide on a language, you would be better off (IMHO) with Rust or Go (or Python 2) than Python 3, generally speaking. Let me turn the question on it's head: Python 3 adopters, can you give me a reason, a technical reason, why I should chose P3 over P2 for any project? I'll throw out some things right off: Performance. No. If you're using Python and worried about performance you've already committed stupidity and I'm not interested. Cython is your friend. Async. No. I write Twisted code. Async has been done. Adding keywords to the language is stupid. (As an aside, I know Twisted is hard to use, and the docs sucked until recently, but it is a damn fine code base, written by really good and committed people, and it's an unsung under-appreciated treasure chest! Any Python networking code that does anything serious and doesn't use Twisted is probably doing too much work, poorly. The last thing the language needed was "async" as a keyword. "Foooooootguuuuuuun Jenkins!") F-strings. No. More stupid and there are dozens of libs that do it. Support? No. I can maintain the P2 code on my own if need be, but I don't need to because there are others, e.g. Tauthon, etc.. and I can support them. Plus as I said above, with no innovation comes no new bugs! Type hints et. al. Ummm..., No. I was really stoked about this, but the first time I tried to use it (MyPy) I immediately broke it. I was doing things with the default keyword argument dict that just couldn't be represented in the type language. Valid useful Python code that the types can't handle is a thing. I like strong types, but Python has never benefited from over-nicety in typing. Quack, quack. Put another way, the coercive-type subset of Python is great but overly restrictive. (Which is not inherently bad, I think Elm-lang is brilliant!) I love Python 2 because it has such a clean syntax, it deals sensibly with all the little fiddly bits that e.g. C makes you think about, and its semantics are powerful and flexible but elegant enough that you can hold the model (or a reasonable homologue) in your head. From my POV Python 3 just messes up 2. I see no compelling technical reasons to use 3.