Is python 3.9 the latest?
3.10.7 Show
September 23, 2022 EditorŁukasz Langa This article explains the new features in Python 3.9, compared to 3.8. Python 3.9 was released on October 5, 2020. For full details, see the changelog. See also PEP 596 - Python 3.9 Release Schedule Summary – Release highlights¶New syntax features:
New built-in features:
New features in the standard library:
Interpreter improvements:
New library modules:
Release process changes:
You should check for DeprecationWarning in your code¶When Python 2.7 was still supported, a lot of functionality in Python 3 was kept for backward compatibility with Python 2.7. With the end of Python 2 support, these backward compatibility layers have been removed, or will be removed soon. Most of them emitted a Test your application with the
Python 3.9 is the last version providing those Python 2 backward compatibility layers, to give more time to Python projects maintainers to organize the removal of the Python 2 support and add support for Python 3.9. Aliases to Abstract Base Classes in the More generally, try to run your tests in the Python Development Mode which helps to prepare your code to make it compatible with the next Python version. Note: a number of pre-existing deprecations were removed in this version of Python as well. Consult the Removed section. New Features¶Dictionary Merge & Update Operators¶Merge ( Example: >>> x = {"key1": "value1 from x", "key2": "value2 from x"} >>> y = {"key2": "value2 from y", "key3": "value3 from y"} >>> x | y {'key1': 'value1 from x', 'key2': 'value2 from y', 'key3': 'value3 from y'} >>> y | x {'key2': 'value2 from x', 'key3': 'value3 from y', 'key1': 'value1 from x'} See PEP 584 for a full description. (Contributed by Brandt Bucher in bpo-36144.) New String Methods to Remove Prefixes and Suffixes¶
Type Hinting Generics in Standard Collections¶In type annotations you can now use built-in collection types such as Example: def greet_all(names: list[str]) -> None: for name in names: print("Hello", name) See PEP 585 for more details. (Contributed by Guido van Rossum, Ethan Smith, and Batuhan Taşkaya in bpo-39481.) New Parser¶Python 3.9 uses a new parser, based on PEG instead of LL(1). The new parser’s performance is roughly comparable to that of the old parser, but the PEG formalism is more flexible than LL(1) when it comes to designing new language features. We’ll start using this flexibility in Python 3.10 and later. The
In Python 3.10, the old parser will be deleted and so will all functionality that depends on it (primarily the See PEP 617 for more details. (Contributed by Guido van Rossum, Pablo Galindo and Lysandros Nikolaou in bpo-40334.) Other Language Changes¶
New Modules¶zoneinfo¶The Example: >>> from zoneinfo import ZoneInfo >>> from datetime import datetime, timedelta >>> # Daylight saving time >>> dt = datetime(2020, 10, 31, 12, tzinfo=ZoneInfo("America/Los_Angeles")) >>> print(dt) 2020-10-31 12:00:00-07:00 >>> dt.tzname() 'PDT' >>> # Standard time >>> dt += timedelta(days=7) >>> print(dt) 2020-11-07 12:00:00-08:00 >>> print(dt.tzname()) PST As a fall-back source of data for platforms that don’t ship the IANA database,
the See also PEP 615 – Support for the IANA Time Zone Database in the Standard LibraryPEP written and implemented by Paul Ganssle graphlib¶A new module, Improved Modules¶ast¶Added the indent option to Added Added docstrings to AST nodes that contains the ASDL signature used to construct that node. (Contributed by Batuhan Taskaya in bpo-39638.) asyncio¶Due to significant security concerns, the reuse_address parameter of
Added a new coroutine Added Added a new
coroutine When cancelling the task due to a timeout,
compileall¶Added new possibility to use hardlinks for duplicated Added new options for path manipulation in resulting concurrent.futures¶Added a new cancel_futures parameter to Removed daemon threads from Workers in
curses¶Added datetime¶The distutils¶The upload command now creates SHA2-256 and Blake2b-256 hash digests. It skips MD5 on platforms that block MD5 digest. (Contributed by Christian Heimes in bpo-40698.) fcntl¶Added constants ftplib¶
gc¶When the garbage collector makes a collection in which some objects resurrect (they are reachable from outside the isolated cycles after the finalizers have been executed), do not block the collection of all objects that are still unreachable. (Contributed by Pablo Galindo and Tim Peters in bpo-38379.) Added a new function hashlib¶The Builtin hash modules can now be disabled with http¶HTTP status codes IDLE and idlelib¶Added option to toggle cursor blink off. (Contributed by Zackery Spytz in bpo-4603.) Escape key now closes IDLE completion windows. (Contributed by Johnny Najera in bpo-38944.) Added keywords to module name completion list. (Contributed by Terry J. Reedy in bpo-37765.) New in 3.9 maintenance releases Make IDLE invoke
The changes above have been backported to 3.8 maintenance releases. Rearrange the settings dialog. Split the General tab into Windows and Shell/Ed tabs. Move help sources, which extend the Help menu, to the Extensions tab. Make space for new options and shorten the dialog. The latter makes the dialog better fit small screens. (Contributed by Terry Jan Reedy in bpo-40468.) Move the indent space setting from the Font tab to the new Windows tab. (Contributed by Mark Roseman and Terry Jan Reedy in bpo-33962.) Apply syntax highlighting to .pyi files. (Contributed by Alex Waygood and Terry Jan Reedy in bpo-45447.) imaplib¶
importlib¶To improve consistency with import statements, Import loaders which publish immutable module objects can now publish immutable packages in addition to individual modules. (Contributed by Dino Viehland in bpo-39336.) Added
Refreshed inspect¶
ipaddress¶
Scoped IPv6 addresses can be parsed using Starting with Python 3.9.5 the math¶Expanded the Added Added
Added multiprocessing¶The nntplib¶
os¶Added Exposed the Linux-specific The The
Added
pathlib¶Added
pdb¶On Windows now poplib¶
pprint¶
pydoc¶The documentation string is now shown not only for class, function, method etc, but for any object that has its own random¶Added a new signal¶Exposed the
Linux-specific smtplib¶
socket¶The The socket module now supports the The socket module now
has the time¶On AIX, sys¶Added a new Previously, tracemalloc¶Added typing¶PEP 593 introduced an unicodedata¶The Unicode database has been updated to version 13.0.0. (bpo-39926). venv¶The activation scripts provided by
xml¶White space characters within attributes are now preserved when serializing Optimizations¶
Here’s a summary of performance improvements from Python 3.4 through Python 3.9: Python version 3.4 3.5 3.6 3.7 3.8 3.9 -------------- --- --- --- --- --- --- Variable and attribute read access: read_local 7.1 7.1 5.4 5.1 3.9 3.9 read_nonlocal 7.1 8.1 5.8 5.4 4.4 4.5 read_global 15.5 19.0 14.3 13.6 7.6 7.8 read_builtin 21.1 21.6 18.5 19.0 7.5 7.8 read_classvar_from_class 25.6 26.5 20.7 19.5 18.4 17.9 read_classvar_from_instance 22.8 23.5 18.8 17.1 16.4 16.9 read_instancevar 32.4 33.1 28.0 26.3 25.4 25.3 read_instancevar_slots 27.8 31.3 20.8 20.8 20.2 20.5 read_namedtuple 73.8 57.5 45.0 46.8 18.4 18.7 read_boundmethod 37.6 37.9 29.6 26.9 27.7 41.1 Variable and attribute write access: write_local 8.7 9.3 5.5 5.3 4.3 4.3 write_nonlocal 10.5 11.1 5.6 5.5 4.7 4.8 write_global 19.7 21.2 18.0 18.0 15.8 16.7 write_classvar 92.9 96.0 104.6 102.1 39.2 39.8 write_instancevar 44.6 45.8 40.0 38.9 35.5 37.4 write_instancevar_slots 35.6 36.1 27.3 26.6 25.7 25.8 Data structure read access: read_list 24.2 24.5 20.8 20.8 19.0 19.5 read_deque 24.7 25.5 20.2 20.6 19.8 20.2 read_dict 24.3 25.7 22.3 23.0 21.0 22.4 read_strdict 22.6 24.3 19.5 21.2 18.9 21.5 Data structure write access: write_list 27.1 28.5 22.5 21.6 20.0 20.0 write_deque 28.7 30.1 22.7 21.8 23.5 21.7 write_dict 31.4 33.3 29.3 29.2 24.7 25.4 write_strdict 28.4 29.9 27.5 25.2 23.1 24.5 Stack (or queue) operations: list_append_pop 93.4 112.7 75.4 74.2 50.8 50.6 deque_append_pop 43.5 57.0 49.4 49.2 42.5 44.2 deque_append_popleft 43.7 57.3 49.7 49.7 42.8 46.4 Timing loop: loop_overhead 0.5 0.6 0.4 0.3 0.3 0.3 These results were
generated from the variable access benchmark script at: Deprecated¶
Removed¶
Porting to Python 3.9¶This section lists previously described changes and other bugfixes that may require changes to your code. Changes in the Python API¶
Changes in the C API¶
CPython bytecode changes¶
Build Changes¶
C API Changes¶New Features¶
Porting to Python 3.9¶
Removed¶
Notable changes in Python 3.9.1¶typing¶The behavior of
(Contributed by Yurii Karabas in bpo-42345.) macOS 11.0 (Big Sur) and Apple Silicon Mac support¶As of 3.9.1, Python now fully supports building and running on macOS 11.0 (Big Sur)
and on Apple Silicon Macs (based on the (Contributed by Ronald Oussoren and Lawrence D’Anna in bpo-41100.) Notable changes in Python 3.9.2¶collections.abc¶
urllib.parse¶Earlier Python versions allowed using both Which is the newest python?Python 3.10. 5 is the newest major release of the Python programming language, and it contains many new features and optimizations.
When did Python 3.9 release?Python 3.9 was released on October 5, 2020.
What is the latest version of Python 2022?Stable Releases. Python 3.7.14 - Sept. 6, 2022. ... . Python 3.8.14 - Sept. 6, 2022. ... . Python 3.9.14 - Sept. 6, 2022. ... . Python 3.10.7 - Sept. 6, 2022. ... . Python 3.10.6 - Aug. 2, 2022. ... . Python 3.10.5 - June 6, 2022. Note that Python 3.10.5 cannot be used on Windows 7 or earlier. ... . Python 3.9.13 - May 17, 2022. ... . Python 3.10.4 - March 24, 2022.. How long will Python 3.9 be supported?
|