-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[flake8-slots
] Rule SLOT002
doesn't take typing.NamedTuple
into account
#10805
Comments
Hi, thanks for opening the issue! Can you give a minimal code snippet as an example of where you think this rule should be emitting an error but isn't currently? |
Ah, do you mean something like this? from typing import NamedTuple
class Foo(NamedTuple("Foo", [("x", int)])):
pass It's unusual to inherit from a call-based from typing import NamedTuple
class Foo(NamedTuple):
x: int And if you create a class-based |
Oh, I didn't know that this example: from typing import NamedTuple
class Foo(NamedTuple):
x: int will have the And I didn't know about the call-based NamedTuple as well 😅 (it is not used in the Home Assistant codebase), but that would be a good idea to add. |
Hello 😊
While adding the
SLOT
rules to Home Assistant, I found that theSLOT002
doesn't take subclasses oftyping.NamedTuple
in account, although they are the typed version ofcollections.namedtuple
.Thanks in advance!
The text was updated successfully, but these errors were encountered: