Skip to content

Conversation

@AlexWaygood
Copy link
Member

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions
Copy link
Contributor

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

@JelleZijlstra
Copy link
Member

Would anything break if we unconditionally did from typing import NamedTuple as NamedTuple? We already do that for overload too.

@AlexWaygood
Copy link
Member Author

AlexWaygood commented Jul 14, 2022

Would anything break if we unconditionally did from typing import NamedTuple as NamedTuple? We already do that for overload too.

My thinking was that type checkers might want to distinguish typing_extensions.NamedTuple from typing.NamedTuple, so that they can emit an error if a user tries to create a generic typing.NamedTuple on <3.11, since that will fail at runtime. I.e., it would be a similar argument to the argument made in #7130 for declaring typing_extensions.Protocol as a distinct symbol to typing.Protocol.

This is purely hypothetical, however.

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.

Mypy and Pyright complain when importing new NamedTuple

3 participants