-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Don't return properties as parameters of dataclasses
- Loading branch information
Showing
2 changed files
with
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1566,6 +1566,7 @@ def parameters(self) -> Parameters: | |
*[ | ||
Parameter(attr.name, annotation=attr.annotation, default=attr.value) | ||
for attr in self.attributes.values() | ||
if "property" not in attr.labels | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
pawamoy
Author
Member
|
||
], | ||
) | ||
return Parameters() | ||
|
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
There is also the case of non-init fields and so are not parameters.
z
should not be a parameter.