Friday, July 19, 2019

What’s Coming in Python 3.8

Jake Edge (via Hacker News):

Out of that came a new operator, however, that is often called the “walrus operator” due to its visual appearance. Using “:=“ in an if or while statement allows assigning a value to a variable while testing it.

[…]

The f-strings (or formatted strings) added into Python 3.6 are quite useful, but Pythonistas often found that they were using them the same way in debugging output. So Eric V. Smith proposed some additional syntax for f-strings to help with debugging output.

[…]

Another change for 3.8 affords pure-Python functions the same options for parameters that those implemented in C already have. PEP 570 (“Python Positional-Only Parameters”) introduces new syntax that can be used in function definitions to denote positional-only arguments—parameters that cannot be passed as keyword arguments.

Previously:

Comments RSS · Twitter

Leave a Comment