Skip to content

Commit e8a9fdc

Browse files
committed
feat: Get class parameters from parent's __init__ method
Issue #205: #205
1 parent 1c4340b commit e8a9fdc

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎src/griffe/dataclasses.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,11 +1333,15 @@ def __init__(
13331333
def parameters(self) -> Parameters:
13341334
"""Return the parameters of this class' `__init__` method, if any.
13351335
1336+
This property fetches inherited members,
1337+
and therefore is part of the consumer API:
1338+
do not use when producing Griffe trees!
1339+
13361340
Returns:
1337-
The parameters containter.
1341+
The parameters container.
13381342
"""
13391343
try:
1340-
return self.members["__init__"].parameters # type: ignore[union-attr]
1344+
return self.all_members["__init__"].parameters # type: ignore[union-attr]
13411345
except KeyError:
13421346
if "dataclass" in self.labels:
13431347
return Parameters(

0 commit comments

Comments
 (0)