Open clo-vis opened 9 months ago
Possibly related: https://github.com/pylint-dev/pylint/issues/9420
ABC1 has an additional public method "getitem". Is that what you find unexpected that pylint counted?
class Test has two public methods: __getitem__
and method1
(no warning, as expected)
class MyABC1 has two public methods: getitem
and method1
(no warning, as expected)
class MyABC2 has two public methods: __getitem__
and method1
(no warning, as expected)
class Concrete1 implements the abstract method method1
of MyABC1 (no warning, as expected)
class Concrete2 implements the abstract method method1
of MyABC2 (warning, unexpected)
Ah, if the difference is just that too-few-public-methods thinks anything that starts with _
is private even if it's a dunder, then that's just #9420.
According to this logic ("too-few-public-methods thinks anything that starts with _ is private"), then there should be a warning for class Test
- but there is not. (same for class MyABC2
)
Apologies, I took #9420 at face value, but I cannot reproduce the behavior described there. Dunders besides __init__()
are counted as public methods, so that explains why Test
doesn't raise a warning.
Apparently, inherited dunders are not counted. If that's the part you'd like us to reconsider, I'm happy to reopen the issue for additional discussion.
Bug description
Configuration
No response
Command used
Pylint output
Expected behavior
No warning about too few public methods
Pylint version
OS / Environment
No response
Additional dependencies
No response