At Agira, Technology Simplified, Innovation Delivered, and Empowering Business is what we are passionate about. We always strive to build solutions that boost your productivity.

What's New with Python 3.8? Latest Features and Updates

  • By Agira Technologies
  • October 22, 2019

Python 3.8 is the latest version of Python that is made available in the recent past with new cool features and updates. As per the prior announcement given by the Python team, it was about to release Python’s new version into four beta releases. As the first beta version is all set now for the developers to test, beta 2 is out now with multiple features.
Python 3.8b2, the second out of four beta releases is all set with features ready to create the hype.

Whats are the new features of Python 3.8?

There is no doubt that Python’s latest version has created a hype in the industry with its new Walrus operator. Although many developers have different opinions on the operator, the new features are worth the hype. The Python community has begun to find many effective uses of the new major 17 features of the latest Python version.
Let’s take a look at the new features of Python 3.8b2

1.Assignment expressions

The walrus operator allows you to assign values to variables within an expression. While, Python uses = for assignment and == for comparison, the walrus operator (:=) allows assignment within an expression.
Consider the example below.

if (n := len(a)) > 10:
    print(f"List is too long ({n} elements, expected <= 10)")

This feature was the sensational debate among the Python community in July 2018 which led to the resignation of a Python author from his BDFL role. To resolve the issue, the Python team is introducing this new governance model for Python with a steering council.

Image result for walrus operator
Source – -Coding For Everybody

Here is what you can do with walrus operator.

  1. Assign values to variables as part of a larger expression.
  2. Match regular expressions if match objects are needed twice.
  3. Use in While-loops that compute a value to test loop termination and require that same value again in the body of the loop.
  4. Use in list comprehensions where a value computed in a filtering condition is also needed in the expression body.

The operator aims to simplify things by balancing lines of codes and complexity, and also avoids inefficient comprehensions and unnecessary variables in scope.
Some of the developers complain that the operator might diminish the code readability when it is often used. So, the Python team themselves recommend to limit the use of walrus operator to clean cases to reduce complexity.

2. Positional-only parameters

The new function parameter syntax “/” allows you to specify positional-only parameters. It is similar to the function of “*” which indicates that the arguments to its right are keywords only. The library authors can now take control over when expressing the intended usage of an API. You can now change the position-only parameters without breaking callers.
Even for this feature received mixed responses from the Python community. Some of the professional developers thinks that the feature would make things clear. While some others think that this allows authors to dictate how their methods could be used.

3. Python Audit Hooks and Verified Open Hook

You can now use Python Audit Hook and Verified Open Hook that are available in Python and native code to allow applications that are purely written in Python to take advantage of extra notifications. System administrators and embedders can deploy their Python Builds where auditing is enabled.

4. Debug support for f-strings

One can find f-strings or formatted strings from Python 3.6 which allows you to evaluate an expression as the part of string along with inserting the result of function calls and so on. In the latest Python version, a new specifier (=) and !d conversion is is added for the ease of debugging.
The “print-style debugging” has improved if you are an expert in using features from other languages such as Perl, Ruby, JS, etc.
Many developers with different backgrounds think the feature is more useful for them.

5. Python initialization Configuration

Although configuration in Python is quite better, they introduced a new C API to configure the Python Initialization. With this new configuration, you can have a better control and error reporting. You can now easily read and modify the configuration before applying or overriding how Python computes the module search paths.
There are many other exciting features such as vectorcall which is a fast calling protocol for CPython, Pickle protocol 5 with out-of-band data buffers and many other language changes.
Hire the best Python developers in the Industry by getting in touch with Agira technologies. Build faster, reliable and robust web applications for your business at affordable prices within your given timeframe.

Turn your vision to magnificent reality with
Our Web and Mobile Solutions

Get more updates on Python Web Development by subscribing to our blog. Read more related Python blogs in Python web development archives.

Agira Technologies

AgiraTech is a technology company whose business services and domain solutions supports global clients who comprise the current world economy. Services we offer : Web development, Mobile App development, Blockchain, IoT and DevOps Consulting