diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index 1ab54a00b..0b65eac41 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -870,6 +870,10 @@ class _TypedDict(Mapping[str, object], metaclass=ABCMeta): if sys.version_info >= (3, 9): __required_keys__: ClassVar[frozenset[str]] __optional_keys__: ClassVar[frozenset[str]] + # __orig_bases__ sometimes exists on <3.12, but not consistently, + # so we only add it to the stub on 3.12+ + if sys.version_info >= (3, 12): + __orig_bases__: ClassVar[tuple[Any, ...]] def copy(self) -> typing_extensions.Self: ... # Using Never so that only calls using mypy plugin hook that specialize the signature # can go through. diff --git a/stdlib/typing_extensions.pyi b/stdlib/typing_extensions.pyi index 7e643469e..c55a383e8 100644 --- a/stdlib/typing_extensions.pyi +++ b/stdlib/typing_extensions.pyi @@ -148,6 +148,7 @@ class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): __required_keys__: ClassVar[frozenset[str]] __optional_keys__: ClassVar[frozenset[str]] __total__: ClassVar[bool] + __orig_bases__: ClassVar[tuple[Any, ...]] def copy(self) -> Self: ... # Using Never so that only calls using mypy plugin hook that specialize the signature # can go through.