Python 3.8 new features

in Pythonlast year

Python 3.8 has laucnhed with a whole set of new features, this video provides a summary of the hightlighted changes on the language. If you preffered to read them please go to the official Python site for this document with examples. Things to look forward are:

  • Assignment expressions
  • Positional-only parameters
  • Parallel filesystem cache for compiled bytecode files
  • Debug build uses the same ABI as release build
  • f-strings support = for self-documenting expressions and debugging
  • PEP 578: Python Runtime Audit Hooks
  • PEP 587: Python Initialization Configuration

The features according to the videos got a bit complex when using the wallrus operator, so there might be a bit of too many esoteric features for the language. The positional only parameters seemed to be already added on a previous release. This might have been just some minor tweaks on it.

There is a new function parameter syntax / to indicate that some function parameters must be specified positionally and cannot be used as keyword arguments. This is the same notation shown by help() for C functions annotated with Larry Hastings’ Argument Clinic tool.

This feature as well doesnt seem to be too much value added by Pretty Printed.

Then there is the parallel filesystem cache.

The new PYTHONPYCACHEPREFIX setting (also available as -X pycache_prefix) configures the implicit bytecode cache to use a separate parallel filesystem tree, rather than the default __pycache__ subdirectories within each source directory.

This might have been for people that have the need to fine tune the optimization of the language. But for most users I dont see much value.

Pretty printed seemed much more exited with the f-strings support and the new expressions and debugging features for this.