Python

5 new features in Python 3.9 that you care about

1️⃣ Merging Dictionaries

There is a new merge operator (|) which can be used to merge two dictionaries.

Merging dictionaries in Python 3.9
Merging dictionaries in Python 3.9

For more details see: https://www.python.org/dev/peps/pep-0584/

2️⃣ Updating Dictionaries

The new update operator (|=) can be used to update as well as merge dictionaries.

Updating dictionaries in Python 3.9
Updating dictionaries in Python 3.9

For more details see: https://www.python.org/dev/peps/pep-0584/

3️⃣ Removing prefix and suffix from string

Two new methods are introduced to remove prefix and suffix from the string.

Removing prefix and suffix from string using Python 3.9
Removing prefix and suffix from string using Python 3.9

4️⃣ Built-in Generic Types

You can now use built in collection types such as list and dict as generic types making the code much more readable.

Generic Types in Python 3.9
Generic Types in Python 3.9

For more details see: https://www.python.org/dev/peps/pep-0585/

5️⃣ New Python Parser

Python 3.9 uses a new parser, based on PEG instead of LL(1). Well, this parser is much more flexible than the old one, and it will be used to build new features starting with Python 3.10.

In Python 3.10, the old parser will be deleted and so will all functionality that depends on it.

Read more here: https://www.python.org/dev/peps/pep-0617/