-
-
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
False positives with keywords-only fields of dataclasses #5767
Labels
Milestone
Comments
Related #3492 |
Happens with the """Quick test to demonstrate pylint errors when using kw_only dataclass
fields."""
from dataclasses import dataclass, field
@dataclass
class Creature:
"""Defines a creature with one or more names (first names, middle names,
last names, etc.)"""
names: list[str] = field(kw_only=True)
@dataclass
class Human(Creature):
"""Defines a human who has a home address."""
address: str
donna = Human('1858 Hidden Meadow Drive, East Grand Forks, ND 56721',
names=['Donna', 'Jennings'])
print(donna) Running pylint (2.12.2):
Running Python 3.10.2:
|
A valuable test case was given in #7290 that should pass when fixing this issue. |
Pierre-Sassoulas
pushed a commit
to DanielNoord/pylint
that referenced
this issue
Aug 23, 2022
Pierre-Sassoulas
pushed a commit
to DanielNoord/pylint
that referenced
this issue
Aug 23, 2022
DanielNoord
referenced
this issue
in DanielNoord/pylint
Aug 23, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug description
Pylint version
The text was updated successfully, but these errors were encountered: