-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
dataclasses
plugins does not respect slots=True
argument
#11482
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
Labels
bug
mypy got something wrong
Comments
I cannot assign myself, but consider me assigned 🙂 |
We also need to check for slots confict: from dataclasses import dataclass
@dataclass(slots=True)
class Some:
__slots__ = ('x',)
x: int
# Traceback (most recent call last):
# ...
# TypeError: Some already specifies __slots__ |
hauntsaninja
pushed a commit
that referenced
this issue
Nov 7, 2021
JukkaL
pushed a commit
that referenced
this issue
Nov 9, 2021
tushar-deepsource
pushed a commit
to DeepSourceCorp/mypy
that referenced
this issue
Jan 20, 2022
tushar-deepsource
pushed a commit
to DeepSourceCorp/mypy
that referenced
this issue
Jan 20, 2022
) Closes python#11487 Refs python#11482 Refs python#10801
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since
3.10
now hasslots=True
argument for@dataclass
decorator, we need to support it, since #10864 is merged.Failing case right now:
Compare it with regular class, which works fine:
Docs: https://docs.python.org/3/library/dataclasses.html#dataclasses.dataclass
Refs #11463
The text was updated successfully, but these errors were encountered: