-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend the dataclass plugin to deal with callable properties (#10292)
At runtime, the callable properties of dataclasses are handled in the way one would expect: they are not passed a `self` argument. Mypy, however, just sees them as callable class attributes and generates errors about missing arguments. This is a special case of what is discussed in #708. I donʼt have a general solution for that problem, but for dataclasses, I can fix it by automatically converting the callable entries in a data class into (settable) properties. That makes them work properly via-a-vis the typechecker.
- Loading branch information
Showing
2 changed files
with
93 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters