File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 66import types
77import typing
88import uuid
9+ import weakref
910from collections .abc import Callable , Mapping , Sequence , Set
1011from dataclasses import dataclass
1112from datetime import date , datetime , time , timedelta
@@ -811,10 +812,7 @@ def _is_typing_type_instance(annotation: Any, type_name: str) -> bool:
811812
812813
813814def _is_new_type_instance (annotation : Any ) -> bool :
814- if sys .version_info >= (3 , 10 ):
815- return _is_typing_type_instance (annotation , "NewType" )
816- else :
817- return hasattr (annotation , "__supertype__" )
815+ return _is_typing_type_instance (annotation , "NewType" )
818816
819817
820818def _is_type_var_instance (annotation : Any ) -> bool :
@@ -848,7 +846,7 @@ def resolve_type_alias(annotation: Any) -> Any:
848846 return resolution
849847
850848
851- class_registry = weakref .WeakValueDictionary () # type: ignore
849+ class_registry = weakref .WeakValueDictionary ()
852850
853851default_registry = registry ()
854852
You can’t perform that action at this time.
0 commit comments