mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-06 21:55:38 +07:00
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.
13 lines
147 B
Python
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
|