-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
Steps to reproduce
- Create
test.py:
#!/usr/bin/env python3
# pylint: disable=too-few-public-methods,missing-docstring
class Path:
def __init__(self, name):
self.name = name
def __getitem__(self, name):
return type(self)(f"{self.name}/{name}")
class Special(Path):
def action(self):
print(self.name)
def main():
spam = Special("spam")
eggs = spam["eggs"]
print(type(eggs))
eggs.action()
if __name__ == "__main__":
main()- Run pylint.
pylint test.py
Current behavior
************* Module test
test.py:21:4: E1101: Instance of 'Path' has no 'action' member (no-member)
------------------------------------------------------------------
Your code has been rated at 6.67/10 (previous run: 6.67/10, +0.00)
Expected behavior
No finding. eggs should have been inferred as instance of Special, not Path.
pylint --version output
pylint 2.0.0
astroid 2.0
Python 3.6.6 (default, Jun 27 2018, 13:11:40)
[GCC 8.1.1 20180531]