From acfde4e40b3a75aeff1d6324a4eb9adbca5579e2 Mon Sep 17 00:00:00 2001 From: James Hilton-Balfe Date: Sun, 23 Apr 2023 22:13:43 +0100 Subject: [PATCH] Add stubs for types.get_original_bases (#10073) Co-authored-by: Jelle Zijlstra Co-authored-by: Alex Waygood --- stdlib/types.pyi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stdlib/types.pyi b/stdlib/types.pyi index 22acb5a2f..43475d912 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -56,6 +56,9 @@ if sys.version_info >= (3, 9): if sys.version_info >= (3, 10): __all__ += ["EllipsisType", "NoneType", "NotImplementedType", "UnionType"] +if sys.version_info >= (3, 12): + __all__ += ["get_original_bases"] + # Note, all classes "defined" here require special handling. _T1 = TypeVar("_T1") @@ -563,6 +566,9 @@ def prepare_class( name: str, bases: tuple[type, ...] = (), kwds: dict[str, Any] | None = None ) -> tuple[type, dict[str, Any], dict[str, Any]]: ... +if sys.version_info >= (3, 12): + def get_original_bases(__cls: type) -> tuple[Any, ...]: ... + # Actually a different type, but `property` is special and we want that too. DynamicClassAttribute = property