Skip to content

Releases: python/typing_extensions

4.11.0

05 Apr 12:36
d4d929d
Compare
Choose a tag to compare

Release 4.11.0 (April 5, 2024)

This feature release provides improvements to various recently
added features, most importantly type parameter defaults (PEP 696).

There are no changes since 4.11.0rc1.

Changes since 4.10.0:

  • Fix tests on Python 3.13.0a5. Patch by Jelle Zijlstra.
  • Fix the runtime behavior of type parameters with defaults (PEP 696).
    Patch by Nadir Chowdhury.
  • Fix minor discrepancy between error messages produced by typing
    and typing_extensions on Python 3.10. Patch by Jelle Zijlstra.
  • When include_extra=False, get_type_hints() now strips ReadOnly from the annotation.

4.11.0rc1

24 Mar 14:05
94bec44
Compare
Choose a tag to compare
  • Fix tests on Python 3.13.0a5. Patch by Jelle Zijlstra.
  • Fix the runtime behavior of type parameters with defaults (PEP 696).
    Patch by Nadir Chowdhury.
  • Fix minor discrepancy between error messages produced by typing
    and typing_extensions on Python 3.10. Patch by Jelle Zijlstra.
  • When include_extra=False, get_type_hints() now strips ReadOnly from the annotation.

4.10.0

26 Feb 14:39
ed81f2b
Compare
Choose a tag to compare

Release 4.10.0 (February 25, 2024)

This feature release adds support for PEP 728 (TypedDict with extra
items) and PEP 742 (TypeIs).

There are no changes since 4.10.0rc1.

4.10.0rc1

18 Feb 02:59
06b23e3
Compare
Choose a tag to compare

Release 4.10.0rc1 (February 17, 2024)

  • Add support for PEP 728, supporting the closed keyword argument and the
    special __extra_items__ key for TypedDict. Patch by Zixuan James Li.
  • Add support for PEP 742, adding typing_extensions.TypeIs. Patch
    by Jelle Zijlstra.
  • Drop runtime error when a read-only TypedDict item overrides a mutable
    one. Type checkers should still flag this as an error. Patch by Jelle
    Zijlstra.
  • Speedup issubclass() checks against simple runtime-checkable protocols by
    around 6% (backporting python/cpython#112717, by Alex
    Waygood).
  • Fix a regression in the implementation of protocols where typing.Protocol
    classes that were not marked as @runtime_checkable would be unnecessarily
    introspected, potentially causing exceptions to be raised if the protocol had
    problematic members. Patch by Alex Waygood, backporting
    python/cpython#113401.

4.9.0

10 Dec 01:16
fc461d6
Compare
Choose a tag to compare

This feature release adds typing_extensions.ReadOnly, as specified
by PEP 705, and makes various other improvements, especially to
@typing_extensions.deprecated().

There are no changes since 4.9.0rc1.

4.9.0rc1

29 Nov 18:16
f82d636
Compare
Choose a tag to compare
4.9.0rc1 Pre-release
Pre-release
  • Add support for PEP 705, adding typing_extensions.ReadOnly. Patch
    by Jelle Zijlstra.
  • All parameters on NewType.__call__ are now positional-only. This means that
    the signature of typing_extensions.NewType.__call__ now exactly matches the
    signature of typing.NewType.__call__. Patch by Alex Waygood.
  • Fix bug with using @deprecated on a mixin class. Inheriting from a
    deprecated class now raises a DeprecationWarning. Patch by Jelle Zijlstra.
  • @deprecated now gives a better error message if you pass a non-str
    argument to the msg parameter. Patch by Alex Waygood.
  • @deprecated is now implemented as a class for better introspectability.
    Patch by Jelle Zijlstra.
  • Exclude __match_args__ from Protocol members.
    Backport of python/cpython#110683 by Nikita Sobolev.
  • When creating a typing_extensions.NamedTuple class, ensure __set_name__
    is called on all objects that define __set_name__ and exist in the values
    of the NamedTuple class's class dictionary. Patch by Alex Waygood,
    backporting python/cpython#111876.
  • Improve the error message when trying to call issubclass() against a
    Protocol that has non-method members. Patch by Alex Waygood (backporting
    python/cpython#112344, by Randolph Scholz).

4.8.0

18 Sep 04:03
c17c499
Compare
Choose a tag to compare

Changes since 4.7.1:

  • Add typing_extensions.Doc, as proposed by PEP 727. Patch by
    Sebastián Ramírez.
  • Drop support for Python 3.7 (including PyPy-3.7). Patch by Alex Waygood.
  • Fix bug where get_original_bases() would return incorrect results when
    called on a concrete subclass of a generic class. Patch by Alex Waygood
    (backporting python/cpython#107584, by James
    Hilton-Balfe).
  • Fix bug where ParamSpec(default=...) would raise a TypeError on Python
    versions <3.11. Patch by James Hilton-Balfe

No changes since 4.8.0rc1.

4.8.0rc1

08 Sep 00:47
7e29499
Compare
Choose a tag to compare
4.8.0rc1 Pre-release
Pre-release
  • Add typing_extensions.Doc, as proposed by PEP 727. Patch by
    Sebastián Ramírez.
  • Drop support for Python 3.7 (including PyPy-3.7). Patch by Alex Waygood.
  • Fix bug where get_original_bases() would return incorrect results when
    called on a concrete subclass of a generic class. Patch by Alex Waygood
    (backporting python/cpython#107584, by James
    Hilton-Balfe).
  • Fix bug where ParamSpec(default=...) would raise a TypeError on Python
    versions <3.11. Patch by James Hilton-Balfe

4.7.1

02 Jul 14:21
b518f6a
Compare
Choose a tag to compare
  • Fix support for TypedDict, NamedTuple and is_protocol on PyPy-3.7 and
    PyPy-3.8. Patch by Alex Waygood. Note that PyPy-3.7 and PyPy-3.8 are unsupported
    by the PyPy project. The next feature release of typing-extensions will
    drop support for PyPy-3.7 and may also drop support for PyPy-3.8.

4.7.0

28 Jun 21:04
633d2e2
Compare
Choose a tag to compare

This is a feature release. Major changes include:

  • All non-deprecated names from typing are now re-exported by typing_extensions for convenience
  • Add typing_extensions.get_protocol_members and typing_extensions.is_protocol
  • Declare support for Python 3.12
  • This will be the last feature release to support Python 3.7, which recently reached its end-of-life

Full changelog of versions 4.7.0 and 4.7.0rc1:

Release 4.7.0 (June 28, 2023)

  • This is expected to be the last feature release supporting Python 3.7,
    which reaches its end of life on June 27, 2023. Version 4.8.0 will support
    only Python 3.8.0 and up.
  • Fix bug where a typing_extensions.Protocol class that had one or more
    non-callable members would raise TypeError when issubclass()
    was called against it, even if it defined a custom __subclasshook__
    method. The correct behaviour -- which has now been restored -- is not to
    raise TypeError in these situations if a custom __subclasshook__ method
    is defined. Patch by Alex Waygood (backporting
    python/cpython#105976).

Release 4.7.0rc1 (June 21, 2023)

  • Add typing_extensions.get_protocol_members and
    typing_extensions.is_protocol (backport of CPython PR #104878).
    Patch by Jelle Zijlstra.
  • typing_extensions now re-exports all names in the standard library's
    typing module, except the deprecated ByteString. Patch by Jelle
    Zijlstra.
  • Due to changes in the implementation of typing_extensions.Protocol,
    typing.runtime_checkable can now be used on typing_extensions.Protocol
    (previously, users had to use typing_extensions.runtime_checkable if they
    were using typing_extensions.Protocol).
  • Align the implementation of TypedDict with the implementation in the
    standard library on Python 3.9 and higher.
    typing_extensions.TypedDict is now a function instead of a class. The
    private functions _check_fails, _dict_new, and _typeddict_new
    have been removed. is_typeddict now returns False when called with
    TypedDict itself as the argument. Patch by Jelle Zijlstra.
  • Declare support for Python 3.12. Patch by Jelle Zijlstra.
  • Fix tests on Python 3.13, which removes support for creating
    TypedDict classes through the keyword-argument syntax. Patch by
    Jelle Zijlstra.
  • Fix a regression introduced in v4.6.3 that meant that
    issubclass(object, typing_extensions.Protocol) would erroneously raise
    TypeError. Patch by Alex Waygood (backporting the CPython PR
    python/cpython#105239).
  • Allow Protocol classes to inherit from typing_extensions.Buffer or
    collections.abc.Buffer. Patch by Alex Waygood (backporting
    python/cpython#104827, by Jelle Zijlstra).
  • Allow classes to inherit from both typing.Protocol and typing_extensions.Protocol
    simultaneously. Since v4.6.0, this caused TypeError to be raised due to a
    metaclass conflict. Patch by Alex Waygood.
  • Backport several deprecations from CPython relating to unusual ways to
    create TypedDicts and NamedTuples. CPython PRs #105609 and #105780
    by Alex Waygood; typing_extensions backport by Jelle Zijlstra.
    • Creating a NamedTuple using the functional syntax with keyword arguments
      (NT = NamedTuple("NT", a=int)) is now deprecated.
    • Creating a NamedTuple with zero fields using the syntax NT = NamedTuple("NT")
      or NT = NamedTuple("NT", None) is now deprecated.
    • Creating a TypedDict with zero fields using the syntax TD = TypedDict("TD")
      or TD = TypedDict("TD", None) is now deprecated.
  • Fix bug on Python 3.7 where a protocol X that had a member a would not be
    considered an implicit subclass of an unrelated protocol Y that only has a
    member a. Where the members of X are a superset of the members of Y,
    X should always be considered a subclass of Y iff Y is a
    runtime-checkable protocol that only has callable members. Patch by Alex
    Waygood (backporting CPython PR
    python/cpython#105835).