What’s New in Python 3.9 alpha2?

What’s New in Python 3.9 alpha2?

Python is set to release a new version next year, the shiny 3.9. This one omitted the sys.argv change rolled back in alpha2 Here’s our take of the most noticeable changes:

Keyword Arguments Get Some Boost

improved

original

Audit hooks added for sys.excepthook() and sys.unraisablehook()

Audit hooks were added in PEP 578. It basically allows you to monitor low-level details. It’s aim is to monitor behaviors of Python scripts more accurately. Example of use in the wording of the PEP:

Auditing bypass can occur when the typical system tool used for an action would ordinarily report its use, but accessing the APIs via Python do not trigger this. For example, invoking “curl” to make HTTP requests may be specifically monitored in an audited system, but Python’s “urlretrieve” function is not.

Calling replace on a code object now raises the code.__new__ audit event.

The code object is returned when using the in-built compile() function on some codes. The corresponding C code:

Thread stack size set to 8 Mb for debug builds on Android

An initiated script crashes on Android API 24 but only in debug mode. The maximum recursion limit was reduced from 1000 to 100.

In Python you can’t recurse more than some limit.

The above patch was implemented by defining THREAD_STACK_SIZE to 8mb

Added __floor__ and __ceil__ method to float object

Was not previously implemented. Also added tests.

Use of python -m pip instead of pip to upgrade dependencies in venv

In cpython/Lib/venv/__init__.py alongsize some other changes, the below update sets python -m pip install as default for dependencies upgrade

Excape key also closes IDLE completion windows

Many keys are used in auto completion. The escape key was just added

That’s was my funnified personal pick!

  •  
  •  
  •  
  •  

Lives in Mauritius, cruising python waters for now.

Comments are closed.