Python 3.8 version was released on 14, October, 2019 with various major and minor updates compare to its previous version Python 3.7. It includes new programming features, new and improved modules, and packages etc. Lets have a look in the detailed description.
Walrus Operator is added to the new release. This new operator assigns values to variables as part of a larger expression. The syntax of this operator is := (eye and tusks of walrus) that’s why it is known as walrus operator.
Python included a new syntax “/” to indicate that some parameters are position-only and can’t be used as keyword arguments. The benefits of marking a parameter as positional-only is that it allows the parameter name to be changed in the future without risk of breaking client code. Suppose we have a function having parameters a,b then in the future we can change these names to x,y without breaking any code.
The Python introduced new PYTHONPYCACHEPREFIX setting which configures the implicit bytecode cache to use a separate parallel filesystem tree, rather than the defaul__pycache__subdirectories within each source directory in the Python.
The Python new version now uses the same ABI for Build and debug Build mode. On Unix platform, when Python is built in debug mode, it is now possible to load C extensions built in release mode and C extensions built using the stable ABI.
Python added an equal (=) specifier to f-strings. An f-string such as f'{expr=}' will expand to the text of the expression, an equal sign, then the representation of the evaluated expression in Python.
Python added two hooks one for audit and second for verified Open Hook. Both hooks are available from Python and its native code that allow to take advantage of notification for applications and frameworks written in pure Python.
Python3.8 version added new C API to configure the Python Initialization process which provides better control on the whole configuration and error reporting.
A new protocol “vectorcall” is added to the Python/C API. It is meant to formalize existing optimizations which were already done for various classes. Any extension type implementing a callable can use this protocol.
A new importlib.metadata module provides (provisional) support for reading metadata from third-party packages. For example, it can extract an installed package’s version number, list of entry points etc.