Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use typing.NamedTuple instead of collections.namedtuple #822

Closed
wants to merge 2 commits into from

Conversation

DimitriPapadopoulos
Copy link
Contributor

Inheriting from typing.NamedTuple creates a custom tuple subclass in the same way as using the collections.namedtuple factory function. However, using typing.NamedTuple allows you to provide a type annotation for each field in the class.

Inheriting from `typing.NamedTuple` creates a custom `tuple` subclass
in the same way as using the `collections.namedtuple` factory function.
However, using `typing.NamedTuple` allows you to provide a type annotation
for each field in the class.
@brettcannon
Copy link
Member

What's the point of the change if there's no change in typing?

@DimitriPapadopoulos DimitriPapadopoulos deleted the PYI024 branch August 27, 2024 19:15
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.

2 participants