Open pylint-bot opened 9 years ago
Originally reported by: Claudiu Popa (BitBucket: PCManticore, GitHub: PCManticore)
The following code shows that if a member is not found in the current class, it will be looked into the parent, even though the __init__ was changed and the parent's init wasn't called.
__init__
#!python from astroid.test_utils import extract_node n = extract_node(''' class A(object): def __init__(self): self.value = 42 def __add__(self, other): return other.value + self.value / 2 class B(A): def __init__(self): self.value1 = 24 def __radd__(self, other): return NotImplemented A() + B() B().value ''') print(repr(n)) inferred = next(n.infer()) print(next(inferred.igetattr('value')).value)
Originally reported by: Claudiu Popa (BitBucket: PCManticore, GitHub: PCManticore)
The following code shows that if a member is not found in the current class, it will be looked into the parent, even though the
__init__
was changed and the parent's init wasn't called.