Skip to content

Commit

Permalink
refactor: Add target setter
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Nov 28, 2021
1 parent 78fb70b commit 7f0064c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/griffe/dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,12 @@ def target(self) -> Object | Alias:
self.resolve_target()
return self._target # type: ignore[return-value] # cannot return None, exception is raised

@target.setter
def target(self, value: Object | Alias) -> None:
self._target = value
if self.parent is not None:
self._target.aliases[self.path] = self

def resolve_target(self) -> None:
"""Resolve the target.
Expand Down

0 comments on commit 7f0064c

Please sign in to comment.