From 174a2334b46a117a939b871d0ea0de5049447ded Mon Sep 17 00:00:00 2001 From: Stephen Morton Date: Sun, 22 Dec 2024 23:15:25 -0800 Subject: [PATCH] add types.GenericAlias.__mro_entries__ --- stdlib/@tests/stubtest_allowlists/py310.txt | 1 - stdlib/@tests/stubtest_allowlists/py311.txt | 1 - stdlib/@tests/stubtest_allowlists/py312.txt | 1 - stdlib/@tests/stubtest_allowlists/py313.txt | 1 - stdlib/@tests/stubtest_allowlists/py39.txt | 1 - stdlib/types.pyi | 1 + 6 files changed, 1 insertion(+), 5 deletions(-) diff --git a/stdlib/@tests/stubtest_allowlists/py310.txt b/stdlib/@tests/stubtest_allowlists/py310.txt index 93e595839d40..1c03cb4af9a8 100644 --- a/stdlib/@tests/stubtest_allowlists/py310.txt +++ b/stdlib/@tests/stubtest_allowlists/py310.txt @@ -201,7 +201,6 @@ importlib.abc.Traversable.open # Problematic protocol signature at runtime, see os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392 types.GenericAlias.__getattr__ -types.GenericAlias.__mro_entries__ typing\.NamedTuple # Super-special typing primitive weakref.ProxyType.__reversed__ # Doesn't really exist diff --git a/stdlib/@tests/stubtest_allowlists/py311.txt b/stdlib/@tests/stubtest_allowlists/py311.txt index 4841231d6eb6..9c29ffe3731c 100644 --- a/stdlib/@tests/stubtest_allowlists/py311.txt +++ b/stdlib/@tests/stubtest_allowlists/py311.txt @@ -182,7 +182,6 @@ importlib.abc.Traversable.open # Problematic protocol signature at runtime, see os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392 types.GenericAlias.__getattr__ -types.GenericAlias.__mro_entries__ typing\.NamedTuple # Super-special typing primitive weakref.ProxyType.__reversed__ # Doesn't really exist diff --git a/stdlib/@tests/stubtest_allowlists/py312.txt b/stdlib/@tests/stubtest_allowlists/py312.txt index 9ae160e7e819..ae0389d6f4ff 100644 --- a/stdlib/@tests/stubtest_allowlists/py312.txt +++ b/stdlib/@tests/stubtest_allowlists/py312.txt @@ -196,7 +196,6 @@ importlib.abc.Traversable.open # Problematic protocol signature at runtime, see os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392 types.GenericAlias.__getattr__ -types.GenericAlias.__mro_entries__ typing\.NamedTuple # Super-special typing primitive weakref.ProxyType.__reversed__ # Doesn't really exist diff --git a/stdlib/@tests/stubtest_allowlists/py313.txt b/stdlib/@tests/stubtest_allowlists/py313.txt index 4049026a4c37..d00b5172c4cf 100644 --- a/stdlib/@tests/stubtest_allowlists/py313.txt +++ b/stdlib/@tests/stubtest_allowlists/py313.txt @@ -209,6 +209,5 @@ importlib.abc.Traversable.open # Problematic protocol signature at runtime, see os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392 types.GenericAlias.__getattr__ -types.GenericAlias.__mro_entries__ typing\.NamedTuple # Super-special typing primitive weakref.ProxyType.__reversed__ # Doesn't really exist diff --git a/stdlib/@tests/stubtest_allowlists/py39.txt b/stdlib/@tests/stubtest_allowlists/py39.txt index 991f638fb46f..3a45a5686c38 100644 --- a/stdlib/@tests/stubtest_allowlists/py39.txt +++ b/stdlib/@tests/stubtest_allowlists/py39.txt @@ -162,7 +162,6 @@ importlib.abc.Traversable.open # Problematic protocol signature at runtime, see os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392 types.GenericAlias.__getattr__ -types.GenericAlias.__mro_entries__ typing\.NamedTuple # Super-special typing primitive weakref.ProxyType.__reversed__ # Doesn't really exist diff --git a/stdlib/types.pyi b/stdlib/types.pyi index b513bd77468a..a2ca7ff09664 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -608,6 +608,7 @@ if sys.version_info >= (3, 9): def __getitem__(self, typeargs: Any, /) -> GenericAlias: ... def __eq__(self, value: object, /) -> bool: ... def __hash__(self) -> int: ... + def __mro_entries__(self, bases: Iterable[object], /) -> tuple[type]: ... if sys.version_info >= (3, 11): @property def __unpacked__(self) -> bool: ...