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: duplicates when using properties getters and setters #7261

Closed
VasLem opened this issue Aug 3, 2022 · 2 comments
Closed

pyreverse: duplicates when using properties getters and setters #7261

VasLem opened this issue Aug 3, 2022 · 2 comments
Labels
Bug 🪲 pyreverse Related to pyreverse component
Milestone

Comments

@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?

Originally posted by @VasLem in #83 (comment)

@Pierre-Sassoulas Pierre-Sassoulas added Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling pyreverse Related to pyreverse component labels Aug 3, 2022
@clavedeluna
Copy link
Contributor

This is due to these two lines:

        if self._cacheDir is None:
            self.cacheDir = cacheDir

removing them for testing makes the duplication go away.

@clavedeluna clavedeluna added Bug 🪲 and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Jan 9, 2023
@nickdrozd
Copy link
Contributor

This was fixed by #9004

@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.17.6 milestone Sep 12, 2023
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

4 participants