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: remove duplicated aggregations #83

Closed
pylint-bot opened this issue Sep 24, 2013 · 4 comments
Closed

pyreverse: remove duplicated aggregations #83

pylint-bot opened this issue Sep 24, 2013 · 4 comments
Labels
Bug 🪲 pyreverse Related to pyreverse component

Comments

@pylint-bot
Copy link

Originally reported by: Anonymous


i had some strange cases where i had two the same aggregations for a class. They should be removed.


@pylint-bot
Copy link
Author

Original comment by space one (BitBucket: spaceone, GitHub: @spaceone?):


if it helps: it happened when i had protected class members.
e.g. (untested)

#!python

class Foo(object):
    @property
    def bar(self):
        return self.__bar

    @bar.setter
    def bar(self, bar):
        self.__bar = bar

    def __init__(self):
        self.__bar = Bar()

@pylint-bot
Copy link
Author

Original comment by Emile Anclin (BitBucket: anclin, GitHub: @Anclin?):


With the given example, I couldn't reproduce a behavior where the method "bar" appears two times in the diagram. This is true for the current state and earlier releases, going as far back as astng 0.24 / Pylint 0.26...

By default, Pyreverse calls for method research "node.values()" which returns the first node of each name in node.locals (I don't know why it is/should be the first one though).

I think, if there is a duplicated attribute, it must be in a more complicated situation...

@pylint-bot
Copy link
Author

Original comment by Sylvain Thénault (BitBucket: sthenault, GitHub: @sthenault?):


invalid or deprecated. Feel free to reopen if you may provide a way to reproduce this with recent pylint version.

@pylint-bot pylint-bot added Bug 🪲 pyreverse Related to pyreverse component labels Dec 9, 2015
@VasLem
Copy link

VasLem commented Aug 3, 2022

I have a similar issue, using pylint 2.14.5 and Python 3.8 on this minimal example:

class Block:
    def __init__(self):
        self._cacheDir = None
    @property
    def cacheDir(self):
        if self._cacheDir is None:
            self.cacheDir = cacheDir
        return self._cacheDir

    @cacheDir.setter
    def cacheDir(self, value: str):
        self._cacheDir = value

I get this output:
classes

Is there a way to stop the duplicates from showing up or is this the expected behavior?

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
Development

No branches or pull requests

2 participants