Skip to content

Pyreverse: Duplicate arrows when class attribute is assigned more than once #9267

@bMorgan01

Description

@bMorgan01

Bug description

I get an issue similar to #8522, but it seems to have a different cause. Supposedly this issue was fixed in pylint 3.0.0, but I still see it.

Code:

class A:
    def __init__(self) -> None:
        self.var = 2

class B:
    def __init__(self) -> None:
        self.a_obj = A()

    def func(self):
        self.a_obj = A()
        self.a_obj = A()

Result:
classes

Configuration

No response

Command used

pyreverse . -o png

Pylint output

Format png is not supported natively. Pyreverse will try to generate it using Graphviz...
Analysed 2 modules with a total of 0 imports

Expected behavior

Duplicate arrows do not appear

Pylint version

pylint 3.0.2
astroid 3.0.1
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]

OS / Environment

Windows 10 / powershell

Additional dependencies

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug 🪲Good first issueFriendly and approachable by new contributorspyreverseRelated to pyreverse component

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions