-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
bugmypy got something wrongmypy got something wrongtopic-dataclassestopic-runtime-semanticsmypy doesn't model runtime semantics correctlymypy doesn't model runtime semantics correctly
Description
Bug Report
Dunder-variables on dataclasses are considered to be arguments instead of ignored, per the dataclass documentation.
To Reproduce
https://mypy-play.net/?gist=27221945829d19cc0407d970cc1cb1f8
from dataclasses import dataclass
@dataclass
class Example:
a: int
__name__: str
e = Example(1) # error: Missing positional argument "__name__" in call to "Example" [call-arg]Python run time does not consider __name__ as a required arguments, but mypy does.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongtopic-dataclassestopic-runtime-semanticsmypy doesn't model runtime semantics correctlymypy doesn't model runtime semantics correctly