Python 3.10 Officially Released with New Syntax / Typing Features [PPA]

Last updated: October 6, 2021

After several alpha, beta and rc tests, the Python programming language finally released version 3.10 today!

Python 3.10 will receive bug-fix updates in next 18 months. After that, it’s supported with 5-year security updates until October 2026.

What’s New in Python 3.10:

  • Pattern matching syntax, inspired by similar syntax found in Scala, Erlang, and other languages.
  • Support using enclosing parentheses for continuation across multiple lines in context managers
  • Allow writing union types as X | Y
  • Add optional length-checking to zip
  • Precise line numbers for debugging and other tools
  • Require OpenSSL 1.1.1 or newer
  • Remove Py_UNICODE encoder APIs
  • Add optional EncodingWarning
  • Explicit Type Aliases
  • Parameter Specification Variables

See the release note for more about Python 3.10.

How to Install Python 3.10 in Ubuntu:

The well trusted “deadsnakes” team PPA has made the packages for Ubuntu 20.04, Ubuntu 18.04, and derivatives, e.g., Linux Mint 20, Elementary OS 6 and Zorin OS 16.

1.) Firstly, open terminal by either searching from overview screen or pressing Ctrl+Alt+T on keyboard. When it opens, run command to add the PPA:

sudo add-apt-repository ppa:deadsnakes/ppa

2.) Then refresh system cache and install the language via command:

sudo apt update && sudo apt install python3.10

Use Python 3.10 as default Python3:

It’s possible to make Python3 in Ubuntu to be Python3.10 via following commands. However, it causes issues, such as Gnome Terminal refuses to launch. Do it at your own risk!

  • Check current Python3 version:
    python3 --version
  • Use update-alternatives to create symbolic links to python3 (replace python3.8 in Ubuntu 16.04 with ):
    sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
    sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 2
  • And choose which one to use as Python3 via command:
    sudo update-alternatives --config python3

Twitter

I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to let me know if the tutorial is outdated! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via ubuntuhandbook1@gmail.com Buy me a coffee: https://ko-fi.com/ubuntuhandbook1 |

2 responses to Python 3.10 Officially Released with New Syntax / Typing Features [PPA]

  1. Python 3.11 is now available …
    https://www.python.org/ftp/python/

    • The developer team starts working on the new version once 3.10 was released. And Python 3.11 is now at first alpha.