Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Upgrade typing_extensions to 4.13.2
  • Loading branch information
pfmoore committed Apr 11, 2025
commit 3427d969981c01a824e27a89151ec40d911818b2
2 changes: 1 addition & 1 deletion news/typing_extensions.vendor.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Upgrade typing_extensions to 4.13.0
Upgrade typing_extensions to 4.13.2
42 changes: 30 additions & 12 deletions src/pip/_vendor/typing_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2072,7 +2072,7 @@ def _create_concatenate_alias(origin, parameters):
if parameters[-1] is ... and sys.version_info < (3, 9, 2):
# Hack: Arguments must be types, replace it with one.
parameters = (*parameters[:-1], _EllipsisDummy)
if sys.version_info >= (3, 10, 2):
if sys.version_info >= (3, 10, 3):
concatenate = _ConcatenateGenericAlias(origin, parameters,
_typevar_types=(TypeVar, ParamSpec),
_paramspec_tvars=True)
Expand Down Expand Up @@ -3123,7 +3123,8 @@ def method(self) -> None:
return arg


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

@functools.wraps(original_new)
def __new__(cls, *args, **kwargs):
def __new__(cls, /, *args, **kwargs):
if cls is arg:
warnings.warn(msg, category=category, stacklevel=stacklevel + 1)
if original_new is not object.__new__:
Expand Down Expand Up @@ -3827,14 +3828,27 @@ def __ror__(self, other):
TypeAliasType = typing.TypeAliasType
# 3.8-3.13
else:
def _is_unionable(obj):
"""Corresponds to is_unionable() in unionobject.c in CPython."""
return obj is None or isinstance(obj, (
type,
_types.GenericAlias,
_types.UnionType,
TypeAliasType,
))
if sys.version_info >= (3, 12):
# 3.12-3.14
def _is_unionable(obj):
"""Corresponds to is_unionable() in unionobject.c in CPython."""
return obj is None or isinstance(obj, (
type,
_types.GenericAlias,
_types.UnionType,
typing.TypeAliasType,
TypeAliasType,
))
else:
# 3.8-3.11
def _is_unionable(obj):
"""Corresponds to is_unionable() in unionobject.c in CPython."""
return obj is None or isinstance(obj, (
type,
_types.GenericAlias,
_types.UnionType,
TypeAliasType,
))

if sys.version_info < (3, 10):
# Copied and pasted from https://github.com/python/cpython/blob/986a4e1b6fcae7fe7a1d0a26aea446107dd58dd2/Objects/genericaliasobject.c#L568-L582,
Expand Down Expand Up @@ -4371,7 +4385,11 @@ def _lax_type_check(
A lax Python 3.11+ like version of typing._type_check
"""
if hasattr(typing, "_type_convert"):
if _FORWARD_REF_HAS_CLASS:
if (
sys.version_info >= (3, 10, 3)
or (3, 9, 10) < sys.version_info[:3] < (3, 10)
):
# allow_special_forms introduced later cpython/#30926 (bpo-46539)
type_ = typing._type_convert(
value,
module=module,
Expand Down
2 changes: 1 addition & 1 deletion src/pip/_vendor/vendor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ requests==2.32.3
urllib3==1.26.20
rich==14.0.0
pygments==2.19.1
typing_extensions==4.13.0
typing_extensions==4.13.2
resolvelib==1.1.0
setuptools==70.3.0
tomli==2.2.1
Expand Down