-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
too-few-public-methods: warn only for the parent class #4352
Comments
This make sense, thank you for opening the issue. We're also thinking about disabling this one by default in #3512 |
Reasons summarized in pylinrc file, and reported pylint-dev/pylint#4352
Upping this one, I like the rule but it happens so often with Flask |
Hello, The E.g. #hello.py
class Hello:
def hello(self):
print('Hi')
def goodbye(self):
print(‘Bye’)
#world.py
from hello import Hello
class World(Hello):
def __greeting(self):
print('How are you?') The above still throws the |
Hello, no one worked on it yet, but we welcome all contributions and will review proposals in (hopefully) a timely manner :) |
Steps to reproduce
Given a file
test.py
:Current behavior
Result of
pylint /tmp/test.py
:Expected behavior
No error. When we inherit from some library class, no matter how many public
methods it provides, it should be acceptable to not add any more public
methods. One can e.g. only override some private method, some static class
attribute, rewrite
__init__
, ...It isn't convenient to disable this warning for each class, and it is a pitty to
disable this for the whole project.
pylint --version output
Result of
pylint --version
output:The text was updated successfully, but these errors were encountered: