diff options
| author | robot-piglet <[email protected]> | 2025-05-21 11:40:42 +0300 |
|---|---|---|
| committer | robot-piglet <[email protected]> | 2025-05-21 11:51:50 +0300 |
| commit | 2f8f499d4c3d126540b4a1f738eff5674b828fd0 (patch) | |
| tree | 1e6d3bd79078ab04298713974c05df256d7a5507 /contrib/python/typing-extensions | |
| parent | 0b5c70eb3185276ed967d9f5181decd0e159304a (diff) | |
Intermediate changes
commit_hash:8a49e0ee63428d74bcd80fe804b8bb1b7c066a89
Diffstat (limited to 'contrib/python/typing-extensions')
| -rw-r--r-- | contrib/python/typing-extensions/py3/.dist-info/METADATA | 2 | ||||
| -rw-r--r-- | contrib/python/typing-extensions/py3/typing_extensions.py | 42 | ||||
| -rw-r--r-- | contrib/python/typing-extensions/py3/ya.make | 2 |
3 files changed, 32 insertions, 14 deletions
diff --git a/contrib/python/typing-extensions/py3/.dist-info/METADATA b/contrib/python/typing-extensions/py3/.dist-info/METADATA index 411285fcd26..4b0732f4c7f 100644 --- a/contrib/python/typing-extensions/py3/.dist-info/METADATA +++ b/contrib/python/typing-extensions/py3/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.4 Name: typing_extensions -Version: 4.13.0 +Version: 4.13.2 Summary: Backported and Experimental Type Hints for Python 3.8+ Keywords: annotations,backport,checker,checking,function,hinting,hints,type,typechecking,typehinting,typehints,typing Author-email: "Guido van Rossum, Jukka Lehtosalo, Ćukasz Langa, Michael Lee" <[email protected]> diff --git a/contrib/python/typing-extensions/py3/typing_extensions.py b/contrib/python/typing-extensions/py3/typing_extensions.py index d2fb245bf49..fa89c83efcd 100644 --- a/contrib/python/typing-extensions/py3/typing_extensions.py +++ b/contrib/python/typing-extensions/py3/typing_extensions.py @@ -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) @@ -3123,7 +3123,8 @@ else: # <=3.11 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") @@ -3203,7 +3204,7 @@ else: 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__: @@ -3827,14 +3828,27 @@ if sys.version_info >= (3, 14): 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, @@ -4371,7 +4385,11 @@ else: 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, diff --git a/contrib/python/typing-extensions/py3/ya.make b/contrib/python/typing-extensions/py3/ya.make index c3ebe98d18f..bcd18d9ad38 100644 --- a/contrib/python/typing-extensions/py3/ya.make +++ b/contrib/python/typing-extensions/py3/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(4.13.0) +VERSION(4.13.2) LICENSE(PSF-2.0) |
