Files
Andrey Vlasovskikh e2db1eaa5f Fixed code insight for returning 'self' in base class methods (PY-10977, PY-11413)
If a method of a base class returns a value of this class, then it is
cast to a derived class this method has been invoked on. This cast is
considered safe, since it cannot result in false positives.
2014-01-16 16:49:05 +04:00

13 lines
147 B
Python

class C(object):
def __enter__(self):
return self
class D(C):
def foo(self):
pass
with D() as cm:
cm.foo() # pass