Skip to content

Commit 3427d96

Browse files
committed
Upgrade typing_extensions to 4.13.2
1 parent b4939be commit 3427d96

File tree

3 files changed

+32
-14
lines changed

3 files changed

+32
-14
lines changed

news/typing_extensions.vendor.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Upgrade typing_extensions to 4.13.0
1+
Upgrade typing_extensions to 4.13.2

src/pip/_vendor/typing_extensions.py

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2072,7 +2072,7 @@ def _create_concatenate_alias(origin, parameters):
20722072
if parameters[-1] is ... and sys.version_info < (3, 9, 2):
20732073
# Hack: Arguments must be types, replace it with one.
20742074
parameters = (*parameters[:-1], _EllipsisDummy)
2075-
if sys.version_info >= (3, 10, 2):
2075+
if sys.version_info >= (3, 10, 3):
20762076
concatenate = _ConcatenateGenericAlias(origin, parameters,
20772077
_typevar_types=(TypeVar, ParamSpec),
20782078
_paramspec_tvars=True)
@@ -3123,7 +3123,8 @@ def method(self) -> None:
31233123
return arg
31243124

31253125

3126-
if hasattr(warnings, "deprecated"):
3126+
# Python 3.13.3+ contains a fix for the wrapped __new__
3127+
if sys.version_info >= (3, 13, 3):
31273128
deprecated = warnings.deprecated
31283129
else:
31293130
_T = typing.TypeVar("_T")
@@ -3203,7 +3204,7 @@ def __call__(self, arg: _T, /) -> _T:
32033204
original_new = arg.__new__
32043205

32053206
@functools.wraps(original_new)
3206-
def __new__(cls, *args, **kwargs):
3207+
def __new__(cls, /, *args, **kwargs):
32073208
if cls is arg:
32083209
warnings.warn(msg, category=category, stacklevel=stacklevel + 1)
32093210
if original_new is not object.__new__:
@@ -3827,14 +3828,27 @@ def __ror__(self, other):
38273828
TypeAliasType = typing.TypeAliasType
38283829
# 3.8-3.13
38293830
else:
3830-
def _is_unionable(obj):
3831-
"""Corresponds to is_unionable() in unionobject.c in CPython."""
3832-
return obj is None or isinstance(obj, (
3833-
type,
3834-
_types.GenericAlias,
3835-
_types.UnionType,
3836-
TypeAliasType,
3837-
))
3831+
if sys.version_info >= (3, 12):
3832+
# 3.12-3.14
3833+
def _is_unionable(obj):
3834+
"""Corresponds to is_unionable() in unionobject.c in CPython."""
3835+
return obj is None or isinstance(obj, (
3836+
type,
3837+
_types.GenericAlias,
3838+
_types.UnionType,
3839+
typing.TypeAliasType,
3840+
TypeAliasType,
3841+
))
3842+
else:
3843+
# 3.8-3.11
3844+
def _is_unionable(obj):
3845+
"""Corresponds to is_unionable() in unionobject.c in CPython."""
3846+
return obj is None or isinstance(obj, (
3847+
type,
3848+
_types.GenericAlias,
3849+
_types.UnionType,
3850+
TypeAliasType,
3851+
))
38383852

38393853
if sys.version_info < (3, 10):
38403854
# Copied and pasted from https://github.com/python/cpython/blob/986a4e1b6fcae7fe7a1d0a26aea446107dd58dd2/Objects/genericaliasobject.c#L568-L582,
@@ -4371,7 +4385,11 @@ def _lax_type_check(
43714385
A lax Python 3.11+ like version of typing._type_check
43724386
"""
43734387
if hasattr(typing, "_type_convert"):
4374-
if _FORWARD_REF_HAS_CLASS:
4388+
if (
4389+
sys.version_info >= (3, 10, 3)
4390+
or (3, 9, 10) < sys.version_info[:3] < (3, 10)
4391+
):
4392+
# allow_special_forms introduced later cpython/#30926 (bpo-46539)
43754393
type_ = typing._type_convert(
43764394
value,
43774395
module=module,

src/pip/_vendor/vendor.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ requests==2.32.3
1111
urllib3==1.26.20
1212
rich==14.0.0
1313
pygments==2.19.1
14-
typing_extensions==4.13.0
14+
typing_extensions==4.13.2
1515
resolvelib==1.1.0
1616
setuptools==70.3.0
1717
tomli==2.2.1

0 commit comments

Comments
 (0)