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

Fixes namedtuple type name #3217

Merged
merged 1 commit into from
Sep 29, 2021
Merged

Fixes namedtuple type name #3217

merged 1 commit into from
Sep 29, 2021

Conversation

sobolevn
Copy link
Contributor

The best practice is to match typename with variable name.
For example, mypy reports any other usages as errors: python/mypy#11206 (comment)

The best practice is to match `typename` with variable name.
For example, `mypy` reports any other usages as errors: python/mypy#11206 (comment)
Copy link
Member

@nemacysts nemacysts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR!

for any code archaeologists in the future: the Python docs mention that the variable and typename should match:

To support pickling, the named tuple class should be assigned to a variable that matches typename.

@nemacysts nemacysts merged commit d5a3f9a into Yelp:master Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants