The popularity of Python has increased a lot in recent years. The Python development team announced the release of Python 3.8.0b1 the last week. It’s the first version out of the four planned beta previews of Python 3.8. The new version brings Assignments expressions, Vectorcall protocol for CPython and lot of other updates.
The new release is just the beginning of the beta phase where developers can test its new features and make their application ready for the stable release. Let’s have a look at some of the features you will see the upcoming Python 3.8.
New Features of Python 3.8
This is one of the useful feature Python is bringing with its new version. The assignment expressions were proposed in PEP 572 and accepted as a feature after a long discussion among the Python developers. This feature comes in the form of a new operator (:=) which you can use to assign variables within an expression.
As we know, Python allows us to pass an argument to a function by position, keyword or both. Sometimes, API designers want to restrict passing the arguments by position only, and here this feature comes in. Python 3.8 will introduce a new marker (/) to indicate that the arguments to its left are positional only. This is quite similar to * that shows the arguments to its right are keyword only.
Vectorcall Protocol for CPython
The calling convention impacts the flexibility and performance of your application significantly. In order to optimize the calling of objects, Python 3.8 adds Vectorcall protocol and a calling convention that is already being used for Python and built-in functions internally.
Runtime Audit Hooks
Python 3.8 brings with two new APIs: Audit Hook and Verified Open Hook. These will be used to provide insights into a running Python application. Using these APIs, both application developers and system administrators can integrate Python into their existing monitoring systems.
Python Initialization Configuration
Python is no doubt highly configurable, but it’s also true that the configurations are scattered all around the code. The upcoming version introduces new functions and structures to the Python Initialization C API, which will provide a straightforward and reliable way to configure Python to Python developers.
Needless to say, as this is a beta release, developers are not advised to use it in the production environments. The next beta release is scheduled to be released on 1st July. If you’re interested to know more about Python 3.8 beta 1, check out the official documentation here.