i2tutorials

Python 3.9.0 is out! Major new features of the 3.9 series

Python is a widely-used general-purpose, high-level programming language. Every Release of Python is open-source. Python releases have also been GPL-compatible. Any version of Python can be downloaded from Python Software Foundation website at python.org

This article describes the latest features in Python 3.9, compared to 3.8.

Python 3.9.0

 

Release Date: Oct. 5, 2020

 

This is the stable release of Python 3.9.0

Python 3.9.0 is the latest major release of the Python programming language, and it contains many optimizations and new features.

 

Installer news:

 

Python 3.9.0 is the first version to default to the 64-bit installer on Windows. The installer can also disallow installation on Windows 7. Python 3.9 is unsuited with this unsupported version of Windows.

 

Note: Python 3.9+ cannot be used on Windows 7 or earlier versions.

 

You can download it from the below link,

 

https://www.python.org/downloads/release/python-390/

 

Now scroll mouse on downloads from top menu options and a window will be highlighted, there you can click on Python 3.9.0 button provided below the download for windows option.

 

Python 3.9.0 is out! Major new features of the 3.9 series-1

 

 

If you want to download for different OS’s click on view the full list of downloads available. You can see the below image.

 

 

Or else go to the below link.

 

https://www.python.org/downloads/

 

New major features of the 3.9 series, compared to 3.8:

 

 

This PEP suggests to add a way for CPython extension methods to access context.

Direct pointer dereferences is used by extension methods, reducing or eliminating the performance cost of using module-scoped state over process global state.

 

Dictionary Merge & Update Operators

 

Built-in dict class is added with Merge (|) and update (|=) operators. Theexisting dict.update and {**d1, **d2} methods of merging dictionaries is complemented.

 

This PEP offersa support to enable for the generics syntax in all standard collections presently available in the typing module.

 

 

To decorate existing types with context-specific metadata and new include_extras parameter to typing.get_type_hints() to access the metadata at runtime introduced a typing.Annotated type.

 

 

 

Any valid expression can be used as a decorator. Previously, the grammar was much more restrictive.

 

 

This offersa module calledzoneinfo, to provide a concrete time zone implementation supporting the IANA time zone database. The zoneinfo module supports for the IANA time zone database to the standard library. It adds zoneinfo.ZoneInfo, a concrete datetime.tzinfo application backed by the system’s time zone data.

 

 

str.removeprefix(prefix) and str.removesuffix(suffix) have been added to remove an unnecessary prefix or a suffix from a string. Equivalent bytes, bytearray, and collections.UserString methods have also been added.

 

 

Python 3.9 uses a new parser, based on PEG instead of LL(1). The new parser’s performance iscomparable to that of the old parser, but the PEG formalism is highly flexible than LL(1) when it comes to designing new language features.

The new parser is used by ast module and produces the same AST as the old parser.

In Python 3.10, the old parser will be removed. You can switch back to the LL(1) parser only in Python 3.9 by using a command line switch (-X oldparser) or an environment variable (PYTHONOLDPARSER=1).

 

 

When the garbage collector makes a collection in which some objects resurrect and do not block the collection of all objects that are still unreachable.

Added a new function gc.is_finalized() to check if an object has been finalized by the garbage collector.

 

 

 

 

Exit mobile version