From d9eb2d831eccfe3d0c4ac34cb0efa27d1ed53122 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Sat, 14 Sep 2024 11:12:34 +0300 Subject: [PATCH 1/2] Remove unused `_allowed_types` from `typing.py` --- Lib/typing.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Lib/typing.py b/Lib/typing.py index bcb7bec23a9aa1..caa41d11c0390e 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -2352,11 +2352,6 @@ def greet(name: str) -> None: return val -_allowed_types = (types.FunctionType, types.BuiltinFunctionType, - types.MethodType, types.ModuleType, - WrapperDescriptorType, MethodWrapperType, MethodDescriptorType) - - def get_type_hints(obj, globalns=None, localns=None, include_extras=False, *, format=annotationlib.Format.VALUE): """Return type hints for an object. From 371fa32d36f632c0f1697f5cb0dd51db9cd6e65a Mon Sep 17 00:00:00 2001 From: sobolevn Date: Sat, 14 Sep 2024 11:14:16 +0300 Subject: [PATCH 2/2] And imports --- Lib/typing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/typing.py b/Lib/typing.py index caa41d11c0390e..9377e771d60f4b 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -29,7 +29,7 @@ import operator import sys import types -from types import WrapperDescriptorType, MethodWrapperType, MethodDescriptorType, GenericAlias +from types import GenericAlias from _typing import ( _idfunc,