Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyreverse duplicate arrows #8522

Closed
nickdrozd opened this issue Apr 1, 2023 · 2 comments · Fixed by #9029 or #9093
Closed

Pyreverse duplicate arrows #8522

nickdrozd opened this issue Apr 1, 2023 · 2 comments · Fixed by #9029 or #9093
Labels
Bug 🪲 pyreverse Related to pyreverse component

Comments

@nickdrozd
Copy link
Collaborator

Bug description

Similar to #8189, field type declarations and assignments are recorded separately, resulting in duplicate arrows.

Example:

class A:
    pass

class B:
    a: A

    def __init__(self):
        self.a = A()

classes

Configuration

No response

Command used

pyreverse --only-classnames -o png asdf.py

Pylint output

...

Expected behavior

Just one arrow per field.

Pylint version

pylint 3.0.0a6
astroid 2.16.0dev0
Python 3.11.0 (tags/v3.11.0:deaf509e8f, Nov  9 2022, 13:21:28) [GCC 9.4.0]

OS / Environment

No response

Additional dependencies

No response

@nickdrozd nickdrozd added Bug 🪲 pyreverse Related to pyreverse component labels Apr 1, 2023
@mbyrnepr2
Copy link
Member

The example looks logically identical to the one in 8189; are they different issues?

@DudeNr33
Copy link
Collaborator

DudeNr33 commented Apr 1, 2023

I thought so too at first.
It's probably a special case of this issue and may very well have the same root cause as #8189.
It would be best to first try to tackle the referenced issue and then check if this problem here is solved as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 pyreverse Related to pyreverse component
Projects
None yet
3 participants