Python 3.9 🐍 is out! 🥳

Here are the 5 new features you care about.

🧵👇
1⃣ Merging dictionaries

There's a new operator "|" that can be used to merge two dictionaries.

See PEP 584 for more information: https://www.python.org/dev/peps/pep-0584/

👇
2⃣ Updating dictionaries

Another new operator "|=" will let you update dictionaries.

See PEP 584 for more information: https://www.python.org/dev/peps/pep-0584/

👇
3⃣ Removing the prefix and suffix of a string

There are two new methods added to the str object to remove the prefix and suffix of the string.

We don't need to rely anymore on a much more fragile approach like slicing to do this.

For more info: https://www.python.org/dev/peps/pep-0616

👇
4⃣ Type hinting for built-in generic types

You can now use list or dict built-in collection types as generics in the signature of a function.

This makes the code much more readable and explicit.

More information: https://www.python.org/dev/peps/pep-0585

👇
5⃣ Python is now using a new parser

Why do you care? Well, this parser is much more flexible than the old one, and it will pay off dividends starting with Python 3.10.

More information here: https://www.python.org/dev/peps/pep-0617

👇
There are many other changes and improvements. This includes new modules and several fixes across the language.

You can take a look at the full release notes here: https://docs.python.org/3.9/whatsnew/3.9.html
You can follow @svpino.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: