Python 3.8 Adds Walrus Operator
Written by Mike James   
Thursday, 17 October 2019

The latest release of Python, 3.8, is available with many new features and optimizations. Notable improvements include a walrus operator and positional-only parameters.

 

python3

 

One main change to Python 3.8 is the addition of the so-called "walrus" operator which adds support for assignment expressions to Python. The “walrus” operator := means you can assign values to a variable as part of an expression, so saving some lines of code when you want to use the value of an expression later in your program.

Support has also been added for positional-only parameters (/). Many CPython built-in and standard library functions only accept positional-only parameters, and this new support makes it easier to work with such functions.

The “vectorcall” protocol has been added to the Python/C API. This is based on the "fastcall" convention, which is already used internally by CPython. The new features can be used by any user-defined extension class. Most of the new API is private in CPython 3.8, and the developers plan to finalize the semantics and make it public in Python 3.9. The new vectorcall only applies to the Python/C API, it does not affect the Python language or standard library.

The current release, 3.8. adds an Audit Hook and Verified Open Hook. Both can be used from Python or native code, and are intended to let applications and frameworks take advantage of extra notifications, while also allowing embedders or system administrators to deploy builds of Python where auditing is always enabled.

Python 3.8.0 is available on the Python downloads page and for developers not yet ready to move on to the latest release so is Python 3.7.5. According to Python Insider bugfix releases of 3.7x will continue until mid 2020 and security fixes until mid 2023. 

 
python3

 

 

More Information

Python HomePage

Related Articles

Python 3.7 Released

Python 3.7 Adds Data Handling Classes

Final Release of Python 2.17 Scheduled Beyond Its End of Life

Learn Python with Microsoft or the University of Michigan

Python Set To Be Top Language

Python - The Future Of Programming?

Python Language Of The Year

Visual Studio Python Gets AI-Based IntelliCode

Python Development Trends

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Microsoft Introduces Vector Abstractions Library For .NET
21/11/2024

Microsoft has announced a preview release of the Microsoft Extensions VectorData Abstractions library, which can be used to help integrate vector stores into .NET applications and libraries.



Pico 2W Announced But There Is A Surprise!
25/11/2024

Raspberry Pi released the Pico 2 a few months ago and we have been waiting for the Pico 2W since then. But Pimoroni beat them to the draw with the Pico Plus 2W based on the RM2 radio module and hinted [ ... ]


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info

<ASIN:1871962587>

<ASIN:B07S1K8KLW>

Last Updated ( Thursday, 17 October 2019 )