5 ms·
The code I've written recently relies heavily on async and data classes, both of which are recent additions. I can't imagine choosing Python 2 at this point.
by mrosett 8y ago
The code I've written recently relies heavily on async and data classes, both of which are recent additions. I can't imagine choosing Python 2 at this point.
- backprojection 8y agoSame here. Dataclasses and type annotations are fantastic, not to mention f-strings.
- drej 8y agoThis is all fine for personal/proprietary purposes, but open source can't be that cutting edge. While type annotations are probably fine (3.5), f-strings (3.6) or dataclasses (3.7) won't make it to mainstream OSS anytime soon. But they are great features nonetheless.
- uryga 8y ago> open source can't be that cutting edge. what?
- mroche 8y agoI mean, RHEL 8 is shipping with Python 3.6 and Python 2.7 available. There is no standard /usr/bin/python without making the symlink manually, and the system uses its own internal python for dependent tooling, so it doesn’t conflict with user installed versions. And, based on my experience, general open source is usually much more cutting edge than the larger distros, that’s the whole point.
- simonh 8y agoMy team is moving across from Bash to Python for non-trivial scripting. I hate it, but we're adopting Python 2.x. Our old servers are on SLES 11 which has Python 2.6 and even our new boxes have RHEL 7 which has Python 2.7 only by default. Getting the base system packages updated across all our systems and environments would be monumentally painful, so we're really stuck. It's not that Python 2.x is painful to use or anything, it's still a great language but being stuck using it seems pointless. I'm really upset at the distro vendors, they should have upgraded their base system Python scripts to 3.x years ago and just included 2.7 for legacy support. RHEL 7.0 came out in 2014 for goodness sake.
- j1elo 8y agoLet's check the package "python" in Ubuntu... 14.04 (2014): Python 2 16.04 (2016): Python 2 18.04 (this is obvious but... less than 12 months ago!): you guessed it, Python 2 (!!!) So, still in 2018 and until 2020 (when I guess the next LTS release of Ubuntu is scheduled) all instructions over the internet telling you to run "python" or "pip install" will run Python 2 if copied into your Ubuntu terminal. I already said this in a previous discussion about Python 2 vs. 3: what a lost opportunity.
- acqq 8y agoYou should assume that python means “2” and python3 what it says in the name. The bigger problem is that invoking “python3” and having a script developed for “python3” still doesn’t guarantee that the script will work, there were incompatible changes during python3 history.
- ThatPlayer 8y agoArch Linux has the packages the other way around: the 'python' package is Python 3 while there is a python2 package and binary. I guess Ubuntu has it that way to stop the breaking changes however
- detaro 8y agoYou should expect python to be Python 2 because that's the official recommendation, for compatibility: https://www.python.org/dev/peps/pep-0394/ https://www.python.org/dev/peps/pep-0394/ New code has no problem explicitly requesting python3, old code needs changing to request Python 2, but if you touch it anyways it's of course safer to make that change.
- Macha 8y agoIn case anyone thinks Arch is being crazy here and ignored the PEP (and doesn't read the PEP), note the change here was written in 2011 and approved in 2012 based on Arch's experience moving to python 3 by default in 2010.