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

no-init not emitted #2409

Closed
sushobhit27 opened this issue Aug 14, 2018 · 2 comments · Fixed by #6373
Closed

no-init not emitted #2409

sushobhit27 opened this issue Aug 14, 2018 · 2 comments · Fixed by #6373
Assignees
Milestone

Comments

@sushobhit27
Copy link
Contributor

Steps to reproduce

  1. cat sample5.py
class Fake_1:
    def meth(self, a):
        pass

class Fake_2(object):
    def meth(self, a):
        pass
  1. $ pylint ../sample5.py --disable=useless-object-inheritance

Current behavior

Your code has been rated at 10.00/10 (previous run: 8.33/10, +1.67)

Expected behavior

no-init message should be emitted.

pylint --version output

pylint 2.2.0
astroid 2.0.1
Python 3.6.4 (default, Jan 7 2018, 15:53:53)
[GCC 6.4.0]

@PCManticore
Copy link
Contributor

@sushobhit27 I think this happens because there is a bug with local_attr, which we use to fetch the __init__ method from the local class or from the parents. the bug is that it might also consider the methods from object, which is the default base in Python 3. We most likely need to look into local_attr to fix this bug at the source.

@PCManticore PCManticore added Bug 🪲 Astroid Related to astroid labels Aug 15, 2018
@DanielNoord
Copy link
Collaborator

@Pierre-Sassoulas This message is never raised in our test suite. See https://coveralls.io/builds/48335404/source?filename=pylint%2Fcheckers%2Fclasses%2Fclass_checker.py L808.

However, this seems very controversial. It is perfectly reasonable not to have an __init__ for a class. It doesn't seem like people mind very much (there is no other issue about this message). Shall we just remove the message in 2.14?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants