Python 3.9 is out!
Here are the 5 new features you care about.
Here are the 5 new features you care about.
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/
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/
Updating dictionaries
Another new operator "|=" will let you update dictionaries.
See PEP 584 for more information: https://www.python.org/dev/peps/pep-0584/
Another new operator "|=" will let you update dictionaries.
See PEP 584 for more information: https://www.python.org/dev/peps/pep-0584/
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
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
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
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
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
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 take a look at the full release notes here: https://docs.python.org/3.9/whatsnew/3.9.html