What’s New in Python 3.8

Python 3.8 was officially available on October 14th 2019. Here are release highlights of the new features.

New Features

  • 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
  • Vectorcall: a fast calling protocol for CPython
  • Pickle protocol 5 with out-of-bound data buffers

See details of these new features here

New Modules

The new importlib.metadata module provides (provisional) support for reading metadata from third-party packages.

For example, it can extract an installed package’s version number, list of entry points, and more:

>>> # Note following example requires that the popular "requests"
>>> # package has been installed.
>>>
>>> from importlib.metadata import version, requires, files
>>> version('requests')
'2.22.0'
>>> list(requires('requests'))
['chardet (<3.1.0,>=3.0.2)']
>>> list(files('requests'))[:5]
[PackagePath('requests-2.22.0.dist-info/INSTALLER'),
 PackagePath('requests-2.22.0.dist-info/LICENSE'),
 PackagePath('requests-2.22.0.dist-info/METADATA'),
 PackagePath('requests-2.22.0.dist-info/RECORD'),
 PackagePath('requests-2.22.0.dist-info/WHEEL')]

Improved Modules

  • ast
  • asyncio
  • builtins
  • collections
  • curses
  • ctypes
  • datetime
  • functools
  • gc
  • gettext
  • gzip
  • idlelib and IDLE
  • inspect
  • io
  • json.tool
  • math
  • mmap
  • multiprocessing
  • os
  • os.path
  • pathlib
  • pickle
  • plistlib
  • py_compile
  • shlex
  • shutil
  • socket
  • ssl
  • statistics
  • sys
  • tarfile
  • threading
  • tokenize
  • tkinter
  • time
  • typing
  • unicodedata
  • unittest
  • venv
  • weakref
  • xml

See all these improved modules details here

For more details about this update, please check out the What’s New in Python 3.8 at python.org

Recent Posts

Feel free to share this post!

Scroll to Top