Python 2, Python 3...
I'm a bit out of the loop on the latest. Can folks fill us in on what's going on in terms of different Python versions, what to look out for in the future?
Python 2, Python 3...
I'm a bit out of the loop on the latest. Can folks fill us in on what's going on in terms of different Python versions, what to look out for in the future?
For further actions, you may consider blocking this person and/or reporting abuse
Py3.6 is likely your base target, feature wise. 3.7 has some improvements and more features but 3.6 still has more explicit support. However they are mostly compatible. 3.8 is the newest. 3.9 is in alpha.
If you're looking for asyncio support you would really need 3.5+, but ideally 3.6+.
Good type hint/annotation support is really 3.6+, though 3.5 has some support.
3.6+ has f-strings (f"hi {name}").
3.7 has official built in dataclass support (3.6 has a PyPI package), which is for helping reduce class boilerplate but also helping with memory management.
And 3.8 has those ever-so-controversial (but adorable) walruses. ;)
My own recommendation is for new projects to support Python 3.6 through 3.8, as much as is practical. Python 3.7 is a good "middle ground", as it's available on most (if not all) modern operating systems. Ubuntu 19.04 and onward use 3.7 as the base version, and don't even ship 3.6.
And, of course, Python 2 is at official End Of Life, and thus should be considered dead for all practical intents and purposes.
Python 3.7 is my version of choice. 3.8 doesn't really have anything I need, except for the walrus, and 3rd libraries take a while to add support. 3.7 also had a good deal of performance improvements over 3.6.
I am waiting for 3.9 before leaving 3.7
Python 2 is effectively dead. It has lost official support from 01/01/20. Consider using python 3.6+ for all future projects.
' The master king is dead...long live the king '
Lulz... My RHEL6 customers recently started complaining, "nothing works with our Python, any more." Trying not to sarcastically reply, "you do remember all the emails we sent saying that RHEL6 reaches full de-support come the end of November 2020, right? You need to get off that RHEL6 stuff, like, yesterday" has been challenging.
Python 2 consultants will make good money this year and the next :)
And the next...
...But COBOL programmers will still be going strong long after Py2 coders have massaged their last bits of deployed code.
I think that RHEL is on the hook supporting Python 2.7 with its customers until EOL of RHEL 7. Yum and the base RHEL utils all use 2.7. If they need Python 3 on RHEL 6, Software Collections works just fine.
Python 3 is mainstream and Python 2 is effectively retired. There is one more release coming in April, but the code has been frozen, and it's no longer supported.
If I'm starting a new project, I use Python 3.7 which is also my system-wide default.
If I'm working on a community library, test against 3.6, 3.7, and 3.8.
Once Python 3.8.2 or 3.8.3 is out (currently on 3.8.1), I'll switch my system-wide default over to it.
Walrus operator
if (name := 20) > 30:
I believe this is only supported in Python 3.8+ ?
Python 3.7 or 3.8 is the way to go :D
Python 2.x is officially unsupported starting January, though they pushed the sunsetting date to April: python.org/psf/press-release/pr201...
Better if you get your system at Python 3.7 globally.
I try to use Python 3.8 for my projects since I use Type Annotations on everything now. 3.8 has a lot better support than 3.7 does.
💀💀💀💀 PY2 💀💀💀💀
For me the best one right now, 3.7.x most of the time linux comes with it right of the bat too
Python 2 support is gone and you should use Python 3.7 or 3.8 instead.
Py2 hits the EOL on 01/01/20. Py3 is recommended for future projects.