Skip to content

Commit

Permalink
fix: Preserve inherited attribute on alias inherited members
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Aug 26, 2023
1 parent 9ebff10 commit 1e19e7b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/griffe/dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,10 @@ def docstring(self, docstring: Docstring | None) -> None:
@cached_property
def members(self) -> dict[str, Object | Alias]: # noqa: D102
final_target = self.final_target
return {name: Alias(name, target=member, parent=self) for name, member in final_target.members.items()}
return {
name: Alias(name, target=member, parent=self, inherited=False)
for name, member in final_target.members.items()
}

@property
def labels(self) -> set[str]: # noqa: D102
Expand All @@ -911,7 +914,8 @@ def member_is_exported(self, member: Object | Alias, *, explicitely: bool = True
def inherited_members(self) -> dict[str, Alias]: # noqa: D102
final_target = self.final_target
return {
name: Alias(name, target=member, parent=self) for name, member in final_target.inherited_members.items()
name: Alias(name, target=member, parent=self, inherited=True)
for name, member in final_target.inherited_members.items()
}

def is_kind(self, kind: str | Kind | set[str | Kind]) -> bool: # noqa: D102
Expand Down

0 comments on commit 1e19e7b

Please sign in to comment.