Python
Python 3.6
Python 3.6 Fedora 26’da kurulu olarak gelecek. 3.5 sürümünden yükseltme Fedora 25’te mevcut. Python 3’e dayalı olarak gelen paketlerin hepsi tekrar yapılmalı. Kullanıcı tarafından yazılan Python 3 betiklerinde ve uygulamalarında küçük bir değiştirme gerekebilir. Bununla birlikte Python 3.5 çoğunlukla Python 3.6 ile uyumludur.
Dikkate değer değişikler:
-
Formatted string literals (f-strings):
f"This will be evaluated to foo’s value: {foo}"
-
The order of elements in
**kwargs: keyword
arguments now preserve their order -
The new
secrets
module provides handy helpers for secure token generation in various formats -
Underscores in numeric literals let you break up magic constants to make them easier to read:
1_000_000
-
File system path protocol: Many more standard library APIs, including the builtin
open()
, now supportpathlib.Path
andpathlib.PurePath
objects -
A range of performance improvements.
For more detailed information see the Fedora Magazine announcement article or the upstream release notes. Note the Porting to Python 3.6 section, which lists important information for developers who need to port their Python 3.5 applications.
Python Classroom Lab’ı
Fedora 26 brings in a new Python Classroom Lab. A variant of Fedora targeted at teachers and students of the Python programming langugae. A ready to use environment with Python, PyPy 3, virtualenv, tox, git, Jupyter Notebook and more. It’s ready in three variants: as a GNOME powered desktop or headless for Vagrant and Docker.
Find out more about the Python Classroom Lab on the Fedora Labs website.
Python 3 C.UTF-8 locale
An ongoing challenge within the Python 3 series has been determining a sensible default strategy for handling the “7-bit ASCII” text encoding assumption currently implied by the use of the default C locale.
Starting with Fedora 26, the Fedora system Python includes a backport of Python 3.7’s upcoming locale coercion feature, which means the Python 3 stack will automatically coerce the C locale to C.UTF-8 by setting the LC_CTYPE
environment variable (if neither it nor LC_ALL
are already set) before configuring the process locale. Automatically setting LC_CTYPE
this way means that both the core interpreter and locale-aware C extensions (such as readline
) will assume the use of UTF-8 as the default text encoding, rather than ASCII.
Full details of this new Python feature are contained in PEP 538 — Coercing the legacy C locale to a UTF-8 based local.
Want to help? Learn how to contribute to Fedora Docs ›