Python programmers will be interested to learn that Python 3.8 has now been made available to download, bringing with it a wealth of new features all of which can be found here. Łukasz Langa, CPython core developer, announced its arrival:
“On behalf of the Python development community and the Python 3.8 release team, I’m pleased to announce the availability of Python 3.8.0. Python 3.8.0 is the newest feature release of the Python language, and it contains many new features and optimizations. You can find Python 3.8.0 here:
Most third-party distributors of Python should be making 3.8.0 packages available soon. See the “What’s New in Python 3.8” document for more information about features included in the 3.8 series. Detailed information about all changes made in 3.8.0 can be found in its change log.
Maintenance releases for the 3.8 series will follow at regular bi-monthly intervals starting in December of 2019. We hope you enjoy Python 3.8! Thanks to all of the many volunteers who help make Python Development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organization contributions to the Python Software Foundation.”
Key Features and Enhancements in Python 3.8
Python 3.8 introduces several new features and optimizations that enhance the language’s functionality and performance. One of the most notable additions is the assignment expression, also known as the “walrus operator” (`:=`). This operator allows you to assign values to variables as part of an expression, making code more concise and readable. For example:
if (n := len(a)) > 10:
print(f"List is too long ({n} elements, expected <= 10)")
Another significant feature is the positional-only parameters, which provide more control over function signatures. This feature allows developers to specify certain parameters that must be passed positionally, preventing them from being passed as keyword arguments. This can be particularly useful for creating more robust APIs.
Python 3.8 also includes improvements to the f-string formatting introduced in Python 3.6. Now, you can use the `=` specifier to include both the expression and its value in the string, which is particularly useful for debugging:
user = "Alice"
print(f"{user=}") # Output: user='Alice'
Performance Improvements and Optimizations
In addition to new features, Python 3.8 brings several performance improvements. The `math` module has been optimized, and now includes new functions such as `math.prod()`, which calculates the product of a start value (defaulting to 1) and an iterable of numbers. This can be particularly useful for mathematical computations and data analysis.
Python 3.8 also introduces shared memory for multiprocessing, which allows multiple processes to share data more efficiently. This can significantly speed up applications that rely on parallel processing.
Moreover, the garbage collector has been improved to reduce memory fragmentation and improve overall performance. These enhancements make Python 3.8 a more efficient and powerful tool for developers working on large-scale applications.
Maintenance releases for the 3.8 series will follow at regular bi-monthly intervals starting in December of 2019. We hope you enjoy Python 3.8! Thanks to all of the many volunteers who help make Python Development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organization contributions to the Python Software Foundation.”
Source: Download
Latest Geeky Gadgets Deals
Disclosure: Some of our articles include affiliate links. If you buy something through one of these links, Geeky Gadgets may earn an affiliate commission. Learn about our Disclosure Policy.