7 ms·
My biggest problem with this change (and dataclasses) is that it is not backward compatible (I know that a backport of dataclass is available, but it is only fo
by blindseer 8y ago
My biggest problem with this change (and dataclasses) is that it is not backward compatible (I know that a backport of dataclass is available, but it is only for Python 3.6). Can people tell me how they deal with this? Are you using features that are only available in the version of Python all your colleagues / users have access to? Are you using the latest version of Python and hoping your colleagues and users can upgrade to that version of Python?
One main reason in my opinion as to why Python 2.7 stuck around for so long was that everyone agreed that it was the last stable version of Python 2, and the devs could make Python 3 changes without worrying significantly about backward compatibility. I've been using Python3 since Python 3.3 but have had to write code that was Python 2 compatible for large code bases for about 5 years because I knew colleagues / users of my packages would not upgrade. This meant using a select subset of features in Python 3 that had been backported to a version of Python 2.7 that I knew I could get my colleagues / users to upgrade to. It has been great to watch the language evolve and Python 3 really gets a lot of things right, but adding breaking syntax features every minor release is extremely annoying. I have to have a mental checklist of all the different possible subsets of features I have access to given a minimum version of Python I want to support. I've spent the last couple of years in my professional career converting large Python 2 only code bases to Python 3.3+. But if someone wants to use async, I need to bump the minor version. If someone wants to use type hinting I have to bump the minor version. If someone wants to use f-strings I have to bump the minor version. If someone wants to use data classes I have to bump the minor version. It's nuts (to me anyway)!
This sounds rant-y but I genuinely want to know what other people are doing to mitigate this. I love Python! I have spent years advocating its merits. But thinking about large codebases in Python just worries me and the future doesn't look promising here. Are Python developers hoping that once 2020 arrives they'll have a stable Python release and work on Python 4. We'll have the Python 2/3 split all over again!
My personal opinion is that Python needs an officially maintained translator for the latest Python features back to older versions. My current favorite package is py-backwards [0] but it is rather unmaintained at the moment.
[0] - https://github.com/nvbn/py-backwards https://github.com/nvbn/py-backwards
- marcus_holmes 8y agoA 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 ago