Documentation for a newer release is available. View Latest

Python

Python 3.7

Fedora 29 introduce Python 3.7, que añade numerosas funciones nuevas y optimizaciones en comparación de la versión 3.6, que era la pila Python 3 predeterminada en Fedora 28. Los cambios más notables incluyen:

  • async and await are now reserved keywords.

  • The asyncio module has received new features and significant usability and performance improvements.

  • The time module has gained support for functions with nanosecond resolution.

See What’s new in Python 3.7 and Features for 3.7 for more information. If you have your own Python apps, see Porting to Python 3.7 for information about compatibility-breaking changes and how to fix your applications.

/usr/bin/python is now a separate package

The unversioned python command from /usr/bin/python has been moved into a separate python-unversioned-command package. You will get it by default when you install the python2 package, but you are able to remove it.

Use the python3 command if you need Python 3, and the python2 command if you need Python 2. The python command continues to mean Python 2, but it is not guaranteed to be present.

See the Change page for detailed information and justification for this change.

/usr/bin/virtualenv is now in the python3-virtualenv package

The virtualenv command now comes from the python3-virtualenv package, as opposed to earlier releases where the command was in the python2-virtualenv. This effectively switches the command to Python 3; if you run virtualenv without any additional options, it will create Python 3 environments. Use virtualenv -p python2.7 to get the previously default behavior.

Ansible now uses Python3 by default

The ansible package in Fedora is switching to use Python 3 by default, instead of Python 2. See Automation for details.

No more automagic Python bytecompilation

The current way of automatic Python byte-compiling of files outside Python-specific directories is too magical and error-prone. It is built on heuristics that are increasingly wrong. This change provides a way to opt out of it, and adjusts the guidelines to prefer explicit bytecompilation of such files. Later, the old behavior will either become opt-in only, or cease to exist.

Note that bytecompilation in Python-specific directories (e.g. /usr/lib/python3.6/) is not affected.

See the Fedora Wiki change page for detailed documentation.

Update comps groups to use Python 3

Multiple package groups have been updated to use python3 by default instead of python2. See Distribution-wide Changes for more information.