Skip to content

Commit 32b95c1

Browse files
Add Python 3.15 TypedDict attributes (#15887)
* Add Python 3.15 TypedDict attributes * Use AnnotationForm for TypedDict extra items
1 parent d3504dd commit 32b95c1

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

stdlib/_typeshed/_type_checker_internals.pyi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import sys
66
import typing_extensions
77
from _collections_abc import dict_items, dict_keys, dict_values
8+
from _typeshed import AnnotationForm
89
from abc import ABCMeta
910
from collections.abc import Awaitable, Generator, Iterable, Mapping
1011
from typing import Any, ClassVar, Generic, TypeVar, overload
@@ -28,6 +29,10 @@ class TypedDictFallback(Mapping[str, object], metaclass=ABCMeta):
2829
if sys.version_info >= (3, 13):
2930
__readonly_keys__: ClassVar[frozenset[str]]
3031
__mutable_keys__: ClassVar[frozenset[str]]
32+
if sys.version_info >= (3, 15):
33+
# PEP 728
34+
__closed__: ClassVar[bool | None]
35+
__extra_items__: ClassVar[AnnotationForm]
3136

3237
def copy(self) -> typing_extensions.Self: ...
3338
# Using Never so that only calls using mypy plugin hook that specialize the signature

stdlib/typing.pyi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,10 @@ class _TypedDict(Mapping[str, object], metaclass=ABCMeta):
10821082
if sys.version_info >= (3, 13):
10831083
__readonly_keys__: ClassVar[frozenset[str]]
10841084
__mutable_keys__: ClassVar[frozenset[str]]
1085+
if sys.version_info >= (3, 15):
1086+
# PEP 728
1087+
__closed__: ClassVar[bool | None]
1088+
__extra_items__: ClassVar[Any] # AnnotationForm
10851089

10861090
def copy(self) -> typing_extensions.Self: ...
10871091
# Using Never so that only calls using mypy plugin hook that specialize the signature

0 commit comments

Comments
 (0)