Whats new in Python 3.10 Pre-release

Python has pre-released a new version 3.10 (3.10.0a7) on April 10, 2021 which is still in development, the last stable release was Python 3.09 released on May 20, 2020.

Whats new features in Python 3.10

  1. Parenthesized context managers
  2. Better error messages in the parser
  3. PEP 626: Precise line numbers for debugging and other tools
  4. PEP 634: Structural Pattern Matching
  5. PEP 563: Postponed Evaluation of Annotations Becomes Default
  6. PEP 604: New Type Union Operator
  7. PEP 612: Parameter Specification Variables
  8. PEP 613: TypeAlias Annotation

Some Other Changes:

  1. int type now has a new method int.bit_count() - this method returns the number of ones in the binary expansion of a given integer.
  2. dict.keys(), dict.values() and dict.items() returns a view that has a mapping attribute that gives a types.MappingProxyType object wrapping the original dictionary.
  3. PEP 618: The zip() function now has an optional strict flag, used to require that all the iterables have an equal length.
  4. Builtin and extension functions that take integer arguments no longer accept Decimals, Fractions and other objects that can be converted to integers only with a loss
  5. Static methods (@staticmethod) and class methods (@classmethod) now inherit the method attributes (__module__, __name__, __qualname__, __doc__, __annotations__) and have a new __wrapped__ attribute.
  6. Two new builtin functions – aiter() and anext() have been added to provide asynchronous counterparts to iter() and next()
  7. Assignment expressions can now be used unparenthesized within set literals and set comprehensions, as well as in sequence indexes (but not slices).

Source: See more - https://docs.python.org/3.10/whatsnew/3.10.html


  • yes, this is a early developer release!!
    PEP 623 – Deprecate and prepare for the removal of the wstr member in PyUnicodeObject.
    PEP 604 – Allow writing union types as X | Y
    PEP 612 – Parameter Specification Variables
    PEP 626 – Precise line numbers for debugging and other tools.
    bpo-38605: from __future__ import annotations (PEP 563) is now the default.
    PEP 618 – Add Optional Length-Checking To zip.
    bpo-12782: Parenthesized context managers are now officially allowed.
    PEP 632 – Deprecate distutils module.
    PEP 613 – Explicit Type Aliases
    PEP 634 – Structural Pattern Matching: Specification
    PEP 635 – Structural Pattern Matching: Motivation and Rationale
    PEP 636 – Structural Pattern Matching: Tutorial
    PEP 644 – Require OpenSSL 1.1.1 or newer
    PEP 624 – Remove Py_UNICODE encoder APIs
    PEP 597 – Add optional EncodingWarning
    Read more: https://blog.python.org
    ddve 11 Apr 2121 07:05:56 GMT
  • Further comments disabled!
Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap