Say hello to the all new Python 3.9!🚀

Python’s latest update is here and it brings a set of new features.

Although Python 3.9 is already in its candidate 2 version, the final version is expected to launch next week.

Let’s take a quick look over some of its new features:

  1. Dictionary Unions: Now you can create a new dictionary by merging two dictionaries together using the union operator ‘|’.

Also, now you can update a dictionary with another dictionary or an iterable object like a list or a generator by using the update operator ‘|=’.

  1. Type Hinting: Due to Python’s dynamically typed nature, a lot of errors go unnoticed until runtime due to wrong data types.

With Type Hinting, the types can be specified very clearly!

  1. String Methods: Two new methods have been added- removeprefix and removesuffix which just remove the string mentioned as prefix or suffix.

Though it’s still possible to do it, it’s still good to have these as well now.

There are other changes and additions as well to other modules including a new Parser based on PEG.

#python #datascience