Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra committed Sep 28, 2024
1 parent cae36c7 commit 65da3f1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
5 changes: 5 additions & 0 deletions Doc/deprecations/pending-removal-in-future.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ although there is currently no date scheduled for their removal.

* :class:`typing.Text` (:gh:`92332`).

* The internal class ``typing._UnionGenericAlias`` is no longer used to implement
:class:`typing.Union`. To preserve compatibility with users using this private
class, a compatibility shim will be provided until at least Python 3.17. (Contributed by
Jelle Zijlstra in :gh:`105499`.)

* :class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a value
that is not ``None`` from a test case.

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ Standard names are defined for the following types:

.. versionadded:: 3.10

.. versionchanged:: 3.13
.. versionchanged:: 3.14

This is now an alias for :class:`typing.Union`.

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ These can be used as types in annotations. They all support subscription using
Unions can now be written as ``X | Y``. See
:ref:`union type expressions<types-union>`.

.. versionchanged:: 3.13
.. versionchanged:: 3.14
:class:`types.UnionType` is now an alias for :class:`Union`, and both
``Union[int, str]`` and ``int | str`` create instances of the same class.
To check whether an object is a ``Union`` at runtime, use
Expand Down
2 changes: 0 additions & 2 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1546,8 +1546,6 @@ Optimizations
Removed Modules And APIs
========================

=======

.. _whatsnew313-pep594:

PEP 594: Remove "dead batteries" from the standard library
Expand Down
6 changes: 3 additions & 3 deletions Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1649,11 +1649,11 @@ def __getitem__(self, params):

class _UnionGenericAliasMeta(type):
def __instancecheck__(self, inst: type) -> bool:
warnings._deprecated("_UnionGenericAlias", remove=(3, 15))
warnings._deprecated("_UnionGenericAlias", remove=(3, 17))
return isinstance(inst, Union)

def __eq__(self, other):
warnings._deprecated("_UnionGenericAlias", remove=(3, 15))
warnings._deprecated("_UnionGenericAlias", remove=(3, 17))
if other is _UnionGenericAlias or other is Union:
return True
return NotImplemented
Expand All @@ -1669,7 +1669,7 @@ class _UnionGenericAlias(metaclass=_UnionGenericAliasMeta):
"""
def __new__(cls, self_cls, parameters, /, *, name=None):
warnings._deprecated("_UnionGenericAlias", remove=(3, 15))
warnings._deprecated("_UnionGenericAlias", remove=(3, 17))
return Union[parameters]


Expand Down

0 comments on commit 65da3f1

Please sign in to comment.