Python 3.9 moves towards release and it is worth checking the beta version released and adapt towards the standards. Here is what developers need to know before the release:
Beta 2, the 2nd release in the current sprint couldn’t do the basic
urllib.request.urlopen("https://www.python.org").read() as it wouldn’t find root certificates due to a bug. Since this was a problem only apparent on an installed Python, it wasn’t identified by unit tests. That’s why Beta 3 was not re-done under the same version.
This release, 3.9.0b3, is the third of five planned beta release previews.
Beta release previews are intended to give the wider community the opportunity to test new features and bug fixes and to prepare their projects to support the new feature release.
What can you do to make the release better?
It is highly recommended to your existing projects with 3.9 during the beta phase and report issues found to the Python bug tracker. With a goal of having no ABI changes after beta 5 and as few code changes as possible after 3.9.0rc1. Developers quote – “To achieve that, it will be extremely important to get as much exposure for 3.9 as possible during the beta phase”.
Note: This version of Python 3.9.0b3 is a preview release and its use is not recommended for production environments.
Major new features of the 3.9 series, compared to 3.8
Some of the new major new features and changes in Python 3.9 are:
- PEP 584, Union Operators in
- PEP 585, Type Hinting Generics In Standard Collections
- PEP 593, Flexible function and variable annotations
- PEP 602, Python adopts a stable annual release cadence
- PEP 615, Support for the IANA Time Zone Database in the Standard Library
- PEP 616, String methods to remove prefixes and suffixes
- PEP 617, New PEG parser for CPython
- BPO 38379, garbage collection does not block on resurrected objects;
- BPO 38692, os.pidfd_open added that allows process management without races and signals;
- BPO 39926, Unicode support updated to version 13.0.0;
- BPO 1635741, when Python is initialized multiple times in the same process, it does not leak memory anymore;
- A number of Python builtins (range, tuple, set, frozenset, list, dict) are now sped up using PEP 590 vectorcall;
- A number of Python modules (_abc, audioop, _bz2, _codecs, _contextvars, _crypt, _functools, _json, _locale, operator, resource, time, _weakref) now use multiphase initialization as defined by PEP 489;
- A number of standard library modules (audioop, ast, grp, _hashlib, pwd, _posixsubprocess, random, select, struct, termios, zlib) are now using the stable ABI defined by PEP 384.
The next pre-release, the fourth beta release of Python 3.9, will be 3.9.0b4. It is currently scheduled for 2020-06-29.