Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/whatsnew/fragments/8522.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Don't show arrows more than once in Pyreverse diagrams.

Closes #8522
10 changes: 7 additions & 3 deletions pylint/pyreverse/diagrams.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,13 @@ def extract_relationships(self) -> None:
value, obj, name, "aggregation"
)

for name, values in list(node.associations_type.items()) + list(
node.locals_type.items()
):
associations = node.associations_type.copy()

for name, values in node.locals_type.items():
if name not in associations:
associations[name] = values

for name, values in associations.items():
for value in values:
self.assign_association_relationship(
value, obj, name, "association"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ classDiagram
example2 : int
}
A --* DuplicateArrows : a
A --* DuplicateArrows : a
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def __init__(self):
self.example2 = 2


# OPEN BUG: https://github.com/pylint-dev/pylint/issues/8522
# Test for https://github.com/pylint-dev/pylint/issues/8522
class A:
pass

Expand Down