pylint-dev / pylint

It's not just a linter that annoys you!
https://pylint.readthedocs.io/en/latest/
GNU General Public License v2.0
5.24k stars 1.12k forks source link

[pyreverse] Dunder methods in diagrams #9805

Open kidq330 opened 1 month ago

kidq330 commented 1 month ago

Current problem

I'm using pyreverse to visualize the structure of sympy which is a fairly large project, with a lot of relations modelled by classes, but also some functionality like iterators implemented via dunder methods.

I understand the decision behind not including private methods, but some of the special dunder methods, I'd argue, are part of the public API of an object and so they should be included in the diagram, wdyt?

Desired solution

Special methods (__next__, __iter__, __str__ etc.)should show up in diagrams as member methods, just like public methods do now

Additional context

No response

kidq330 commented 1 month ago

Whoops, might've created the issue too early, I see -f SPECIAL_A does exactly what I wanted, though it isn't explicitly mentioned by the help message. I'll keep the issue open and fix up a PR with modified docs

edit: the output differs when using -fSPECIAL and -fSPECIAL_A, but pyreverse prints Unknown filter mode 'SPECIAL_A' when using the latter.