Skip to content

Commit 95aa599

Browse files
Add NamedTuple __match_args__ attribute (#15906)
1 parent 7e3b6cd commit 95aa599

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

stdlib/_typeshed/_type_checker_internals.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class TypedDictFallback(Mapping[str, object], metaclass=ABCMeta):
6363
class NamedTupleFallback(tuple[Any, ...]):
6464
_field_defaults: ClassVar[dict[str, Any]]
6565
_fields: ClassVar[tuple[str, ...]]
66+
__match_args__: ClassVar[tuple[str, ...]] = ...
6667
# __orig_bases__ sometimes exists on <3.12, but not consistently
6768
# So we only add it to the stub on 3.12+.
6869
if sys.version_info >= (3, 12):

stdlib/typing.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,7 @@ if sys.version_info >= (3, 11):
10491049
class NamedTuple(tuple[Any, ...]):
10501050
_field_defaults: ClassVar[dict[str, Any]]
10511051
_fields: ClassVar[tuple[str, ...]]
1052+
__match_args__: ClassVar[tuple[str, ...]] = ...
10521053
# __orig_bases__ sometimes exists on <3.12, but not consistently
10531054
# So we only add it to the stub on 3.12+.
10541055
if sys.version_info >= (3, 12):

0 commit comments

Comments
 (0)