What's New in Python 3.9
Python’s New Path

There are two significant changes in this update, which we won’t see any immediate impact from — but we will begin to notice a slightly different evolution of Python as a language.

In short, this boils down to:

Python’s parser limitations

Smaller, but more frequent releases

LL(1) and PEG

Around 30 years ago, Guido van Rossum wrote pgen. One of the first pieces of code ever written for Python — it is still in use as Python’s parser to this day [1].

Pgen uses a variant of LL(1)-based grammar. This means our parser reads the code top-down, left-to-right, with a lookahead of just one token.

This essentially means that Python development is limited, because:

The lookahead of one token limits the expressiveness of grammar rules.

Python already contains non-LL(1) grammar, meaning the current parser uses a lot of workarounds, overcomplicating the process.

of workarounds, overcomplicating the process. Even with these workarounds, only so much is possible. The rules can be bent, but not broken.

With LL(1), particular left-recursive syntax can cause an infinite loop in the parse tree, causing stack overflow — as explained by Guido van Rossum here.

These attributes of the LL(1)-based parser limit what is possible in Python.

Python 3.9 has broken from these limitations thanks to a shiny new PEG parser, outlined in PEP 617.

Immediately, we won’t notice this. No changes taking advantage of the new parser will be made before Python 3.10. But after that, the language will have been released from it’s LL(1) shackles.

Development Cycles
['James Briggs']
['Technology', 'Software Development', 'Data Science', 'Programming', 'Python']