Python 3.10 beta in Fedora Linux

The Python developers have already released three beta versions of Python 3.10.0. You can try the latest one in Fedora Linux today! Test your Python code with 3.10 early to be ready for the final 3.10.0 release in October.

Install Python 3.10 on Fedora Linux

If you run Fedora Linux, you can install Python 3.10 from the official software repository with dnf:

$ sudo dnf install python3.10

You might need to enable the updates-testing repository to get the very latest pre-release:

$ sudo dnf install --enablerepo=updates-testing python3.10

As more betas and release candidates will be released, the Fedora package will receive updates. No need to compile your own development version of Python, just install it and have it up to date. The Python developers will add no new features starting with the first beta; you can already enjoy all the new things.

Test your projects with Python 3.10

Run the python3.10 command to use Python 3.10 or create virtual environments with the builtin venv module, tox or with pipenv and poetry. Here’s an example using tox:

$ git clone https://github.com/benjaminp/six.git
Cloning into 'six'...
$ cd six/
$ tox -e py310
py310 run-test: commands[0] | python -m pytest -rfsxX
================== test session starts ===================
platform linux -- Python 3.10.0b3, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
collected 200 items                                      

test_six.py ...................................... [ 19%]
.................................................. [ 44%]
.................................................. [ 69%]
.................................................. [ 94%]
............                                       [100%]

================== 200 passed in 0.43s ===================
________________________ summary _________________________
  py310: commands succeeded
  congratulations :)

If you find a problem with Python 3.10 on Fedora Linux, please do file bug reports at Fedora’s bugzilla or in the Python’s issue tracker. If you aren’t sure if it is a problem in Python, you can contact the Fedora’s Python maintainers directly via email or IRC.

What’s new in Python 3.10

See the full list of news in Python 3.10. You can, for example, try out structural pattern matching:

$ python3.10
Python 3.10.0b3 (default, Jun 17 2021, 00:00:00)
[GCC 10.3.1 20210422 (Red Hat 10.3.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> point = (3, 10)
>>> match point:
...     case (0, 0):
...         print("Origin")
...     case (0, y):
...         print(f"Y={y}")
...     case (x, 0):
...         print(f"X={x}")
...     case (x, y):
...         print(f"X={x}, Y={y}")
...     case _:
...         raise ValueError("Not a point")
... 
X=3, Y=10
>>> x
3
>>> y
10        

And stay tuned for Python 3.10 as python3 in Fedora Linux 35!

For Developers For System Administrators New in Fedora

9 Comments

  1. Katsuharu Tanaka

    Python3.10 doesn’t seem to be supported by Pandas, which is often used for Data Science, but I’m very interested in API stability and def method stability.
    Thank you for providing me with a valuable news article.

    • Janil Garcia

      Have you tried using pandas with it?

      I just successfully created a new virtualenv with Python 3.10 and pandas is working just fine for me.

      I believe Python 3.10 is API compatible with 3.9, just changing internal details in some libraries and maybe adding new optional parameters. Most libraries will be unaffected by the change.

      The new syntax constructs were also additive, so nothing should be broken by them.

  2. Václav Tengler

    nejde to

  3. Alex

    Why python3.10 is normal package instead of the module :(?

    • Because modules are generally not parallel installable and if we want to make them so we would be packaging a “normal package” like this one into a module for no benefit. Maintaining modular packages is needlessly complex and using them from other parts of the Fedora project is almost impossible.

  4. Dilord

    Me gustaría aprender algo básico sobre Python como lenguaje de programación y ver algunos ejemplos sencillos.

Comments are Closed

The opinions expressed on this website are those of each author, not of the author's employer or of Red Hat. Fedora Magazine aspires to publish all content under a Creative Commons license but may not be able to do so in all cases. You are responsible for ensuring that you have the necessary permission to reuse any work on this site. The Fedora logo is a trademark of Red Hat, Inc. Terms and Conditions