Python 3.8, 3.9 or 3.10 for new projects?

craigburmr

New member
Banned User
May 5, 2022
20
1
3
Basically, I deploy on Ubuntu server 20.04 which ships with python 3.8. I developed Python apps using Linux/macOS. Currently, it's 3.9 on macOS. How to Downgrade Python 3.10 to 3.9 was just released days ago and claimed to be 10% faster than Python 3.9. (I use the Python framework Django/Flask/Tornado mostly)

Which version for a new project is better and why? Thanks
 
Last edited:

brass9

Member
Apr 25, 2021
35
22
8
I'm sticking with 3.9 for time being. Not going to use any incompatible syntax/language constructs in my apps for the next 3 years. In my humble experience, backwards compatibility is far more important than using nice syntactic sugars du jour... especially if you'll have to revisit and support an app after a few years...

Get a list of installed python binaries:
Bash:
ls /usr/bin/python*

Then set the alias in your .zsrhrc/.bashrc profile:
Bash:
alias python3=python3.9

Alternatively, you can use update-alternatives to choose the version you want...

create the alternatives:
Bash:
# sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
# sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 2
Then choose the version:
Bash:
# sudo update-alternatives --config python3
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu