Skip to main content

PYTHON 3.8

Python 3.8, released in October 2019, introduced several new features and improvements to the Python programming language.



Here are some key aspects of Python 3.8:

  1. Assignment Expressions (The Walrus Operator): Python 3.8 introduced the assignment expression operator (:=), also known as the "walrus operator." This operator allows assignment expressions within other expressions, enabling more concise and readable code. For example, it's useful in while loops and list comprehensions.

  2. Positional-Only Parameters: Python 3.8 introduced support for defining function parameters as positional-only by prefixing them with a forward slash (/). This allows function authors to specify that certain parameters can only be passed positionally and not by keyword.

  3. f-strings Improvements: Python 3.8 enhanced formatted string literals (f-strings) with the ability to use expressions inside curly braces ({}) for easier debugging. This allows developers to directly embed expressions within f-strings without having to explicitly call functions or format values.

  4. Syntax and Language Enhancements:

    • Python 3.8 introduced various syntax and language enhancements, including the ability to use underscores in numeric literals for better readability (e.g., 1_000_000 instead of 1000000).
    • Additionally, Python 3.8 improved support for using __future__ imports by allowing multiple __future__ statements in a single module.
  5. TypedDict: Python 3.8 introduced the typing.TypedDict class, which provides a way to define dictionaries with a specific set of keys and value types. This allows for more precise type annotations when working with dictionaries.

  6. Other Enhancements:

    • Python 3.8 included various other enhancements and improvements, such as updates to the importlib module with the importlib.metadata API for accessing metadata from installed packages, improvements to the os module, and updates to the multiprocessing module.

Python 3.8 continued to improve the language with new features, syntax enhancements, and performance improvements, making it more powerful, efficient, and developer-friendly. It further solidified Python's position as a leading programming language for a wide range of applications. 

Comments