From 9692ee6d3f434da34e386acead4d633a083f29ec Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Wed, 24 May 2023 11:09:56 -0700 Subject: [PATCH 1/9] Clean up stubtest allowlist for typing --- tests/stubtest_allowlists/py3_common.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/stubtest_allowlists/py3_common.txt b/tests/stubtest_allowlists/py3_common.txt index c2e0b96e64c9..fdb79964b5b0 100644 --- a/tests/stubtest_allowlists/py3_common.txt +++ b/tests/stubtest_allowlists/py3_common.txt @@ -407,10 +407,6 @@ pickle.Unpickler.memo # undocumented implementation detail, has different type re.Pattern.scanner # Undocumented and not useful. #6405 tempfile._TemporaryFileWrapper.[\w_]+ # Dynamically specified by __getattr__, and thus don't exist on the class -# Various classes in typing aren't types at runtime. In addition, mypy thinks some special forms are tautologically defined. -typing.[A-Z]\w+ -typing_extensions\..* - # These are abstract properties at runtime, # but marking them as such in the stub breaks half the the typed-Python ecosystem (see #8726) typing.IO.closed From d192855170b034373c1caa89bcb9af09db2c133a Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Wed, 24 May 2023 11:35:26 -0700 Subject: [PATCH 2/9] More specific allowlist --- stdlib/typing.pyi | 6 ++- stdlib/typing_extensions.pyi | 4 ++ tests/stubtest_allowlists/py3_common.txt | 62 ++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 1 deletion(-) diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index 2a09bda16609..1ab54a00b6a9 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -211,6 +211,7 @@ if sys.version_info >= (3, 11): NotRequired: _SpecialForm LiteralString: _SpecialForm + @_final class TypeVarTuple: @property def __name__(self) -> str: ... @@ -220,16 +221,19 @@ if sys.version_info >= (3, 11): def __typing_prepare_subst__(self, alias: Incomplete, args: Incomplete) -> Incomplete: ... if sys.version_info >= (3, 10): + @_final class ParamSpecArgs: @property def __origin__(self) -> ParamSpec: ... def __init__(self, origin: ParamSpec) -> None: ... + @_final class ParamSpecKwargs: @property def __origin__(self) -> ParamSpec: ... def __init__(self, origin: ParamSpec) -> None: ... + @_final class ParamSpec: @property def __name__(self) -> str: ... @@ -272,7 +276,7 @@ if sys.version_info >= (3, 10): class NewType: def __init__(self, name: str, tp: Any) -> None: ... - def __call__(self, x: _T) -> _T: ... + def __call__(self, __x: _T) -> _T: ... def __or__(self, other: Any) -> _SpecialForm: ... def __ror__(self, other: Any) -> _SpecialForm: ... __supertype__: type diff --git a/stdlib/typing_extensions.pyi b/stdlib/typing_extensions.pyi index 20f9e3928243..b782608b2092 100644 --- a/stdlib/typing_extensions.pyi +++ b/stdlib/typing_extensions.pyi @@ -97,6 +97,7 @@ __all__ = [ "runtime_checkable", "Text", "TypeAlias", + "TypeAliasType", "TypeGuard", "TYPE_CHECKING", "Never", @@ -106,6 +107,7 @@ __all__ = [ "clear_overloads", "get_args", "get_origin", + "get_original_bases", "get_overloads", "get_type_hints", ] @@ -207,10 +209,12 @@ if sys.version_info >= (3, 10): is_typeddict as is_typeddict, ) else: + @final class ParamSpecArgs: __origin__: ParamSpec def __init__(self, origin: ParamSpec) -> None: ... + @final class ParamSpecKwargs: __origin__: ParamSpec def __init__(self, origin: ParamSpec) -> None: ... diff --git a/tests/stubtest_allowlists/py3_common.txt b/tests/stubtest_allowlists/py3_common.txt index fdb79964b5b0..e87dcca83b96 100644 --- a/tests/stubtest_allowlists/py3_common.txt +++ b/tests/stubtest_allowlists/py3_common.txt @@ -407,6 +407,68 @@ pickle.Unpickler.memo # undocumented implementation detail, has different type re.Pattern.scanner # Undocumented and not useful. #6405 tempfile._TemporaryFileWrapper.[\w_]+ # Dynamically specified by __getattr__, and thus don't exist on the class +# Details of runtime definition don't need to be in stubs +typing_extensions\._SpecialForm +typing\._SpecialForm +typing_extensions\.TypeVar +typing_extensions\.TypeVarTuple +typing\.Generic + +# Special primitives +typing_extensions\.NamedTuple +typing_extensions\.LiteralString +typing_extensions\.Final +typing_extensions\.Coroutine +typing_extensions\.Awaitable +typing_extensions\.AsyncIterable +typing_extensions\.AsyncGenerator +typing\.Sized +typing\.Sequence +typing\.Reversible +typing\.Pattern +typing\.NamedTuple +typing\.MutableSet +typing\.MutableSequence +typing\.MutableMapping +typing\.Match +typing\.MappingView +typing\.LiteralString +typing\.KeysView +typing\.Iterator +typing\.Iterable +typing\.ItemsView +typing\.Hashable +typing\.Coroutine +typing\.Collection +typing\.Container +typing\.ByteString +typing\.AwaitableGenerator +typing\.Awaitable +typing\.AsyncIterator +typing\.AsyncIterable +typing\.AsyncGenerator +typing\.Annotated +typing\.AbstractSet + +# We lie in the stub and say it's read-only +typing_extensions\.ParamSpec(Args|Kwargs)\.__origin__ + +# Internal attributes +.*\.__protocol_attrs__ +.*\.__callable_proto_members_only__ + +# Exist at runtime for internal reasons, no need to put them in the stub +typing_extensions\.TypeAliasType\.__call__ +typing_extensions\.TypeAliasType\.__init_subclass__ + +# We call them read-only properties, runtime implementation is slightly different +typing_extensions\.TypeAliasType\.__(parameters|type_params|name|module)__ + +# https://github.com/python/mypy/issues/15302 +typing_extensions\.deprecated +typing_extensions\.get_original_bases +typing_extensions\.override + # These are abstract properties at runtime, # but marking them as such in the stub breaks half the the typed-Python ecosystem (see #8726) typing.IO.closed From 5abf4f192aa8ea151c2e04b92f3196ee543dd37c Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Wed, 24 May 2023 11:45:38 -0700 Subject: [PATCH 3/9] Some more --- tests/stubtest_allowlists/py310.txt | 5 +++++ tests/stubtest_allowlists/py37.txt | 8 ++++++++ tests/stubtest_allowlists/py38.txt | 5 +++++ tests/stubtest_allowlists/py39.txt | 5 +++++ tests/stubtest_allowlists/py3_common.txt | 13 +++++++++---- 5 files changed, 32 insertions(+), 4 deletions(-) diff --git a/tests/stubtest_allowlists/py310.txt b/tests/stubtest_allowlists/py310.txt index bbc90a3ca46a..6e400b51a7ba 100644 --- a/tests/stubtest_allowlists/py310.txt +++ b/tests/stubtest_allowlists/py310.txt @@ -172,3 +172,8 @@ dataclasses.KW_ONLY # We pretend it's a read-only property for forward compatibility with 3.12 typing.ParamSpec(Args|Kwargs).__origin__ + +# https://github.com/python/mypy/issues/15302 +typing_extensions\.assert_never +typing_extensions\.assert_type +typing_extensions\.reveal_type diff --git a/tests/stubtest_allowlists/py37.txt b/tests/stubtest_allowlists/py37.txt index f83cd84b6cdc..ab45331b5531 100644 --- a/tests/stubtest_allowlists/py37.txt +++ b/tests/stubtest_allowlists/py37.txt @@ -151,3 +151,11 @@ types.GetSetDescriptorType.__get__ types.MemberDescriptorType.__get__ types.MethodDescriptorType.__get__ types.WrapperDescriptorType.__get__ + +# https://github.com/python/mypy/issues/15302 +typing_extensions\.assert_never +typing_extensions\.assert_type +typing_extensions\.reveal_type + +# Doesn't exist at runtime +typing\.Protocol diff --git a/tests/stubtest_allowlists/py38.txt b/tests/stubtest_allowlists/py38.txt index 358719ad1426..b5d743981d82 100644 --- a/tests/stubtest_allowlists/py38.txt +++ b/tests/stubtest_allowlists/py38.txt @@ -169,3 +169,8 @@ types.GetSetDescriptorType.__get__ types.MemberDescriptorType.__get__ types.MethodDescriptorType.__get__ types.WrapperDescriptorType.__get__ + +# https://github.com/python/mypy/issues/15302 +typing_extensions\.assert_never +typing_extensions\.assert_type +typing_extensions\.reveal_type diff --git a/tests/stubtest_allowlists/py39.txt b/tests/stubtest_allowlists/py39.txt index 7825eae72f00..8941a665a78d 100644 --- a/tests/stubtest_allowlists/py39.txt +++ b/tests/stubtest_allowlists/py39.txt @@ -165,3 +165,8 @@ types.GetSetDescriptorType.__get__ types.MemberDescriptorType.__get__ types.MethodDescriptorType.__get__ types.WrapperDescriptorType.__get__ + +# https://github.com/python/mypy/issues/15302 +typing_extensions\.assert_never +typing_extensions\.assert_type +typing_extensions\.reveal_type diff --git a/tests/stubtest_allowlists/py3_common.txt b/tests/stubtest_allowlists/py3_common.txt index e87dcca83b96..f2f6ac5b2814 100644 --- a/tests/stubtest_allowlists/py3_common.txt +++ b/tests/stubtest_allowlists/py3_common.txt @@ -408,10 +408,11 @@ re.Pattern.scanner # Undocumented and not useful. #6405 tempfile._TemporaryFileWrapper.[\w_]+ # Dynamically specified by __getattr__, and thus don't exist on the class # Details of runtime definition don't need to be in stubs -typing_extensions\._SpecialForm -typing\._SpecialForm -typing_extensions\.TypeVar -typing_extensions\.TypeVarTuple +typing_extensions\._SpecialForm.* +typing\._SpecialForm.* +typing_extensions\.TypeVar.* +typing_extensions\.TypeVarTuple.* +typing_extensions\.ParamSpec.* typing\.Generic # Special primitives @@ -420,8 +421,10 @@ typing_extensions\.LiteralString typing_extensions\.Final typing_extensions\.Coroutine typing_extensions\.Awaitable +typing_extensions\.AsyncIterator typing_extensions\.AsyncIterable typing_extensions\.AsyncGenerator +typing\.ValuesView typing\.Sized typing\.Sequence typing\.Reversible @@ -432,12 +435,14 @@ typing\.MutableSequence typing\.MutableMapping typing\.Match typing\.MappingView +typing\.Mapping typing\.LiteralString typing\.KeysView typing\.Iterator typing\.Iterable typing\.ItemsView typing\.Hashable +typing\.Generator typing\.Coroutine typing\.Collection typing\.Container From 6d82a333ce57ba6503cfb4b164e7264b57a88cad Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Wed, 24 May 2023 11:56:32 -0700 Subject: [PATCH 4/9] A few more --- stdlib/typing_extensions.pyi | 6 ++++-- tests/stubtest_allowlists/py311.txt | 2 +- tests/stubtest_allowlists/py37.txt | 3 +++ tests/stubtest_allowlists/py38.txt | 3 +++ tests/stubtest_allowlists/py39.txt | 3 +++ tests/stubtest_allowlists/py3_common.txt | 5 +++-- 6 files changed, 17 insertions(+), 5 deletions(-) diff --git a/stdlib/typing_extensions.pyi b/stdlib/typing_extensions.pyi index b782608b2092..a10ac43e1200 100644 --- a/stdlib/typing_extensions.pyi +++ b/stdlib/typing_extensions.pyi @@ -211,12 +211,14 @@ if sys.version_info >= (3, 10): else: @final class ParamSpecArgs: - __origin__: ParamSpec + @property + def __origin__(self) -> ParamSpec: ... def __init__(self, origin: ParamSpec) -> None: ... @final class ParamSpecKwargs: - __origin__: ParamSpec + @property + def __origin__(self) -> ParamSpec: ... def __init__(self, origin: ParamSpec) -> None: ... Concatenate: _SpecialForm diff --git a/tests/stubtest_allowlists/py311.txt b/tests/stubtest_allowlists/py311.txt index 79925f2593d5..9146fb5086be 100644 --- a/tests/stubtest_allowlists/py311.txt +++ b/tests/stubtest_allowlists/py311.txt @@ -126,7 +126,7 @@ contextlib.AbstractAsyncContextManager.__class_getitem__ contextlib.AbstractContextManager.__class_getitem__ # Super-special typing primitives -typing._SpecialForm.__mro_entries__ +typing\._SpecialForm.* typing._TypedDict.__delitem__ typing._TypedDict.__ior__ typing._TypedDict.__or__ diff --git a/tests/stubtest_allowlists/py37.txt b/tests/stubtest_allowlists/py37.txt index ab45331b5531..ef9dd871a27f 100644 --- a/tests/stubtest_allowlists/py37.txt +++ b/tests/stubtest_allowlists/py37.txt @@ -159,3 +159,6 @@ typing_extensions\.reveal_type # Doesn't exist at runtime typing\.Protocol + +# Function at runtime; we pretend it's already a class +typing_extensions\.NewType diff --git a/tests/stubtest_allowlists/py38.txt b/tests/stubtest_allowlists/py38.txt index b5d743981d82..32b56bc56a62 100644 --- a/tests/stubtest_allowlists/py38.txt +++ b/tests/stubtest_allowlists/py38.txt @@ -174,3 +174,6 @@ types.WrapperDescriptorType.__get__ typing_extensions\.assert_never typing_extensions\.assert_type typing_extensions\.reveal_type + +# Function at runtime; we pretend it's already a class +typing_extensions\.NewType diff --git a/tests/stubtest_allowlists/py39.txt b/tests/stubtest_allowlists/py39.txt index 8941a665a78d..054998599966 100644 --- a/tests/stubtest_allowlists/py39.txt +++ b/tests/stubtest_allowlists/py39.txt @@ -170,3 +170,6 @@ types.WrapperDescriptorType.__get__ typing_extensions\.assert_never typing_extensions\.assert_type typing_extensions\.reveal_type + +# Function at runtime; we pretend it's already a class +typing_extensions\.NewType diff --git a/tests/stubtest_allowlists/py3_common.txt b/tests/stubtest_allowlists/py3_common.txt index f2f6ac5b2814..f26dbb27e288 100644 --- a/tests/stubtest_allowlists/py3_common.txt +++ b/tests/stubtest_allowlists/py3_common.txt @@ -409,13 +409,14 @@ tempfile._TemporaryFileWrapper.[\w_]+ # Dynamically specified by __getattr__, a # Details of runtime definition don't need to be in stubs typing_extensions\._SpecialForm.* -typing\._SpecialForm.* typing_extensions\.TypeVar.* typing_extensions\.TypeVarTuple.* typing_extensions\.ParamSpec.* typing\.Generic +typing\.Protocol # Special primitives +typing_extensions\.Annotated typing_extensions\.NamedTuple typing_extensions\.LiteralString typing_extensions\.Final @@ -467,7 +468,7 @@ typing_extensions\.TypeAliasType\.__call__ typing_extensions\.TypeAliasType\.__init_subclass__ # We call them read-only properties, runtime implementation is slightly different -typing_extensions\.TypeAliasType\.__(parameters|type_params|name|module)__ +typing_extensions\.TypeAliasType\.__(parameters|type_params|name|module|value)__ # https://github.com/python/mypy/issues/15302 typing_extensions\.deprecated From a6d0aaf855061647dd4166db9b4b8825ad941c30 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Wed, 24 May 2023 12:05:37 -0700 Subject: [PATCH 5/9] Improve NewType --- stdlib/typing_extensions.pyi | 9 +++++++-- tests/stubtest_allowlists/py37.txt | 3 --- tests/stubtest_allowlists/py38.txt | 3 --- tests/stubtest_allowlists/py39.txt | 3 --- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/stdlib/typing_extensions.pyi b/stdlib/typing_extensions.pyi index a10ac43e1200..7e643469edb6 100644 --- a/stdlib/typing_extensions.pyi +++ b/stdlib/typing_extensions.pyi @@ -22,7 +22,6 @@ from typing import ( # noqa: Y022,Y039 DefaultDict as DefaultDict, Deque as Deque, Mapping, - NewType as NewType, NoReturn as NoReturn, Sequence, SupportsAbs as SupportsAbs, @@ -198,10 +197,11 @@ class SupportsIndex(Protocol, metaclass=abc.ABCMeta): @abc.abstractmethod def __index__(self) -> int: ... -# New things in 3.10 +# New and changed things in 3.10 if sys.version_info >= (3, 10): from typing import ( Concatenate as Concatenate, + NewType as NewType, ParamSpecArgs as ParamSpecArgs, ParamSpecKwargs as ParamSpecKwargs, TypeAlias as TypeAlias, @@ -226,6 +226,11 @@ else: TypeGuard: _SpecialForm def is_typeddict(tp: object) -> bool: ... + class NewType: + def __init__(self, name: str, tp: Any) -> None: ... + def __call__(self, __x: _T) -> _T: ... + __supertype__: type + # New things in 3.11 # NamedTuples are not new, but the ability to create generic NamedTuples is new in 3.11 if sys.version_info >= (3, 11): diff --git a/tests/stubtest_allowlists/py37.txt b/tests/stubtest_allowlists/py37.txt index ef9dd871a27f..ab45331b5531 100644 --- a/tests/stubtest_allowlists/py37.txt +++ b/tests/stubtest_allowlists/py37.txt @@ -159,6 +159,3 @@ typing_extensions\.reveal_type # Doesn't exist at runtime typing\.Protocol - -# Function at runtime; we pretend it's already a class -typing_extensions\.NewType diff --git a/tests/stubtest_allowlists/py38.txt b/tests/stubtest_allowlists/py38.txt index 32b56bc56a62..b5d743981d82 100644 --- a/tests/stubtest_allowlists/py38.txt +++ b/tests/stubtest_allowlists/py38.txt @@ -174,6 +174,3 @@ types.WrapperDescriptorType.__get__ typing_extensions\.assert_never typing_extensions\.assert_type typing_extensions\.reveal_type - -# Function at runtime; we pretend it's already a class -typing_extensions\.NewType diff --git a/tests/stubtest_allowlists/py39.txt b/tests/stubtest_allowlists/py39.txt index 054998599966..8941a665a78d 100644 --- a/tests/stubtest_allowlists/py39.txt +++ b/tests/stubtest_allowlists/py39.txt @@ -170,6 +170,3 @@ types.WrapperDescriptorType.__get__ typing_extensions\.assert_never typing_extensions\.assert_type typing_extensions\.reveal_type - -# Function at runtime; we pretend it's already a class -typing_extensions\.NewType From f7ab0eb5a5f471df95754c8a06d5d384bbdff779 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Wed, 24 May 2023 12:07:33 -0700 Subject: [PATCH 6/9] Maybe now 3.7 will pass --- tests/stubtest_allowlists/py311.txt | 5 +++++ tests/stubtest_allowlists/py3_common.txt | 8 -------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/stubtest_allowlists/py311.txt b/tests/stubtest_allowlists/py311.txt index 9146fb5086be..3bb6112d1ab8 100644 --- a/tests/stubtest_allowlists/py311.txt +++ b/tests/stubtest_allowlists/py311.txt @@ -137,6 +137,11 @@ typing._TypedDict.pop typing._TypedDict.setdefault typing._TypedDict.update typing._TypedDict.values +typing_extensions\.TypeVarTuple.* +typing_extensions\.Final +typing\.NamedTuple +typing\.LiteralString +typing\.Annotated # White lies around defaults dataclasses.KW_ONLY diff --git a/tests/stubtest_allowlists/py3_common.txt b/tests/stubtest_allowlists/py3_common.txt index f26dbb27e288..becb3acccb84 100644 --- a/tests/stubtest_allowlists/py3_common.txt +++ b/tests/stubtest_allowlists/py3_common.txt @@ -410,7 +410,6 @@ tempfile._TemporaryFileWrapper.[\w_]+ # Dynamically specified by __getattr__, a # Details of runtime definition don't need to be in stubs typing_extensions\._SpecialForm.* typing_extensions\.TypeVar.* -typing_extensions\.TypeVarTuple.* typing_extensions\.ParamSpec.* typing\.Generic typing\.Protocol @@ -419,7 +418,6 @@ typing\.Protocol typing_extensions\.Annotated typing_extensions\.NamedTuple typing_extensions\.LiteralString -typing_extensions\.Final typing_extensions\.Coroutine typing_extensions\.Awaitable typing_extensions\.AsyncIterator @@ -430,14 +428,12 @@ typing\.Sized typing\.Sequence typing\.Reversible typing\.Pattern -typing\.NamedTuple typing\.MutableSet typing\.MutableSequence typing\.MutableMapping typing\.Match typing\.MappingView typing\.Mapping -typing\.LiteralString typing\.KeysView typing\.Iterator typing\.Iterable @@ -453,12 +449,8 @@ typing\.Awaitable typing\.AsyncIterator typing\.AsyncIterable typing\.AsyncGenerator -typing\.Annotated typing\.AbstractSet -# We lie in the stub and say it's read-only -typing_extensions\.ParamSpec(Args|Kwargs)\.__origin__ - # Internal attributes .*\.__protocol_attrs__ .*\.__callable_proto_members_only__ From ab3a8b96819fcec87d2a958c5ec74a09c222038e Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Wed, 24 May 2023 12:09:48 -0700 Subject: [PATCH 7/9] Ignore more NewType problems --- tests/stubtest_allowlists/py3_common.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/stubtest_allowlists/py3_common.txt b/tests/stubtest_allowlists/py3_common.txt index becb3acccb84..c378d7922cbf 100644 --- a/tests/stubtest_allowlists/py3_common.txt +++ b/tests/stubtest_allowlists/py3_common.txt @@ -459,10 +459,13 @@ typing\.AbstractSet typing_extensions\.TypeAliasType\.__call__ typing_extensions\.TypeAliasType\.__init_subclass__ +typing_extensions.NewType.__mro_entries__ # just exists for an error message + # We call them read-only properties, runtime implementation is slightly different typing_extensions\.TypeAliasType\.__(parameters|type_params|name|module|value)__ # https://github.com/python/mypy/issues/15302 +typing_extensions.NewType.__call__ typing_extensions\.deprecated typing_extensions\.get_original_bases typing_extensions\.override From 6f85abbc84be708a69a1e0432af6ccfaffc51d5b Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Wed, 24 May 2023 12:11:56 -0700 Subject: [PATCH 8/9] More fixes --- tests/stubtest_allowlists/py310.txt | 5 +++++ tests/stubtest_allowlists/py311.txt | 1 - tests/stubtest_allowlists/py38.txt | 5 +++++ tests/stubtest_allowlists/py39.txt | 5 +++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/stubtest_allowlists/py310.txt b/tests/stubtest_allowlists/py310.txt index 6e400b51a7ba..496f69a52c7a 100644 --- a/tests/stubtest_allowlists/py310.txt +++ b/tests/stubtest_allowlists/py310.txt @@ -177,3 +177,8 @@ typing.ParamSpec(Args|Kwargs).__origin__ typing_extensions\.assert_never typing_extensions\.assert_type typing_extensions\.reveal_type + +# Super-special typing primitives +typing_extensions\.Final +typing\.NamedTuple +typing\.Annotated diff --git a/tests/stubtest_allowlists/py311.txt b/tests/stubtest_allowlists/py311.txt index 3bb6112d1ab8..d0ad57c7a2cb 100644 --- a/tests/stubtest_allowlists/py311.txt +++ b/tests/stubtest_allowlists/py311.txt @@ -137,7 +137,6 @@ typing._TypedDict.pop typing._TypedDict.setdefault typing._TypedDict.update typing._TypedDict.values -typing_extensions\.TypeVarTuple.* typing_extensions\.Final typing\.NamedTuple typing\.LiteralString diff --git a/tests/stubtest_allowlists/py38.txt b/tests/stubtest_allowlists/py38.txt index b5d743981d82..7d30c8d7506f 100644 --- a/tests/stubtest_allowlists/py38.txt +++ b/tests/stubtest_allowlists/py38.txt @@ -174,3 +174,8 @@ types.WrapperDescriptorType.__get__ typing_extensions\.assert_never typing_extensions\.assert_type typing_extensions\.reveal_type + +# Super-special typing primitives +typing_extensions\.Final +typing\.NamedTuple +typing\.Annotated diff --git a/tests/stubtest_allowlists/py39.txt b/tests/stubtest_allowlists/py39.txt index 8941a665a78d..90c9a38aa0d4 100644 --- a/tests/stubtest_allowlists/py39.txt +++ b/tests/stubtest_allowlists/py39.txt @@ -170,3 +170,8 @@ types.WrapperDescriptorType.__get__ typing_extensions\.assert_never typing_extensions\.assert_type typing_extensions\.reveal_type + +# Super-special typing primitives +typing_extensions\.Final +typing\.NamedTuple +typing\.Annotated From 29899b78412055338f152b624485d50124104df7 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Wed, 24 May 2023 12:14:42 -0700 Subject: [PATCH 9/9] More tweaks --- tests/stubtest_allowlists/py310.txt | 1 + tests/stubtest_allowlists/py38.txt | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/stubtest_allowlists/py310.txt b/tests/stubtest_allowlists/py310.txt index 496f69a52c7a..e7849d077e9a 100644 --- a/tests/stubtest_allowlists/py310.txt +++ b/tests/stubtest_allowlists/py310.txt @@ -177,6 +177,7 @@ typing.ParamSpec(Args|Kwargs).__origin__ typing_extensions\.assert_never typing_extensions\.assert_type typing_extensions\.reveal_type +typing.NewType.__call__ # Super-special typing primitives typing_extensions\.Final diff --git a/tests/stubtest_allowlists/py38.txt b/tests/stubtest_allowlists/py38.txt index 7d30c8d7506f..8f1ee8184407 100644 --- a/tests/stubtest_allowlists/py38.txt +++ b/tests/stubtest_allowlists/py38.txt @@ -177,5 +177,3 @@ typing_extensions\.reveal_type # Super-special typing primitives typing_extensions\.Final -typing\.NamedTuple -typing\.Annotated