Skip to content

Add NamedTuple __match_args__ attribute#15906

Draft
charliermarsh wants to merge 1 commit into
python:mainfrom
charliermarsh:charlie/add-namedtuple-match-args
Draft

Add NamedTuple __match_args__ attribute#15906
charliermarsh wants to merge 1 commit into
python:mainfrom
charliermarsh:charlie/add-namedtuple-match-args

Conversation

@charliermarsh

Copy link
Copy Markdown
Contributor

Summary

Python 3.10 adds __match_args__ to classes created by NamedTuple.

This adds the class variable to _typeshed._type_checker_internals.NamedTupleFallback and the obsolete typing.NamedTuple compatibility copy.

This was found while implementing __match_args__ support for named tuples in ty: astral-sh/ruff#25934

@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant