Skip to content

Pyreverse duplicate arrows #8522

@nickdrozd

Description

@nickdrozd

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions