-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Control flowRequires control flow understandingRequires control flow understanding
Description
Steps to reproduce
class ClsA(object):
pass
class ClsB(object):
def __init__(self):
self._some_cls = None
@property
def some_cls(self):
if self._some_cls:
return self._some_cls
self._some_cls = ClsA
return ClsA
def get_object(self):
return self.some_cls()Current behavior
pylint -E /tmp/x.py
************* Module x
E: 19,15: self.some_cls is not callable (not-callable)
Expected behavior
pylint -E /tmp/x.py
No output as the property actually returns a callable. Error should only be reported when there is a certainty, that the property can't return a callable.
pylint --version output
pylint 1.7.4,
astroid 1.5.3
Python 2.7.10 (default, Feb 7 2017, 00:08:15)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]
acatton, ruben-aghayan, voidpp, ColinKennedy, awarecan and 3 more
Metadata
Metadata
Assignees
Labels
Control flowRequires control flow understandingRequires control flow understanding