Important new features in Python 3.8

Read time: 5 min

Dec 13, 2019

The recent Python 3.8 release introduced many interesting new features, optimizations and tweaks. As new Python versions are published, developers must stay up to date with language changes. In this article, we will try to present the most exciting changes.

Assignment operator

The assignment operator lets you create value assignments within larger logic expressions.


>>> if ( value := 1 + 1 ) > 1: # 2 > 1

In this example, we assign 1+1 to a variable (value) and check if it is greater than 1. It is important to note that you can also use an assignment operator inside list comprehension.

New f-strings specifier

Python 3.8 introduces a new ‘=’ specifier available to use inside f-string expressions. The specifier will automatically get the object name with the object value paired.


>>> object='example_value'
>>> f'{object}'
>>> f'object={object}'
>>> f'{object=}'
>>> f'{object=!s}'

This new feature will certainly be helpful in testing and logging. As you can see in the example, it is also possible to use this conversion flag with the new specifier.

New importlib.metadata module

New importlib.metadata module can help you read metadata, such as the version number for packages installed with tools like pip. Let’s check the installed version of Django and its requirements.


>>> from importlib import metadata
>>> metadata.version('django')
>>> metadata.requires('django')
['pytz', 'sqlparse (>=0.2.2)', 'asgiref (~=3.2)', "argon2-cffi (>=16.1.0) ; extra == 'argon2'", "bcrypt ; extra == 'bcrypt'"]

Removed features in Python 3.8

- The macpath module
- isAlive() method of threading.Thread
- platform.popen() method

Deprecated features in Python 3.8

- getchildren() and getiterator() methods of ElementTree
- lgettext(), ldgettext(), lngettext() and ldngettext() of gettext module

To sum up, if your career path includes Python development, it is worth keeping up to date with python releases systematically. Check out our blog for more news.

Schedule /a meeting/

with our specialist Michał Maj

Michał Maj
Michał Maj Business Development Manager

Read more from our brave's writers

Our mission is to be /trusted partner
to our clients/
in the field of webplatform
development & staff augmentation

Check our rank

  • development
  • clutch
Item 1 of 3

0 Professionals

0 Finished project


  • “Not afraid of doing even the most difficult tasks and proposing innovative solutions. They don’t avoid challenges, rely on new technologies, and - most importantly - always carry the projects through from the beginning to the end.”

    Adam Bogdan
    Adam Bogdan Python Developer
Item 1 of 8

/keep in touch/

We're happy to help! Leave your contact data, and we will get in touch with you within one business day.

Tell us about your needs, ask about our experience, portfolio, and even partnership programs.

Contact us

Thinking of

We are on constant lookout for new talents to join our Brave team! Don’t wait and check our latest Job openings!