Skip to content

Commit

Permalink
digraph.py: add type for cyclic imports as a forward reference
Browse files Browse the repository at this point in the history
Signed-off-by: Berin Aniesh <berinaniesh@gmail.com>
  • Loading branch information
berinaniesh committed Jul 10, 2023
1 parent 5a6b4e6 commit c0aa189
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/portage/util/digraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,9 @@ def remove(self, node: "SetArg"):
del self.nodes[node]
self.order.remove(node)

def update(self, other):
def update(self, other: "digraph"):
"""
Add all nodes and edges from another digraph instance.
other: another digraph instance,
can't be type annotated according to PEP 484 due to cyclic imports
"""
for node in other.order:
children, parents, node = other.nodes[node]
Expand Down

0 comments on commit c0aa189

Please sign in to comment.