Created
April 17, 2018 16:07
-
-
Save SirEdvin/66e4dd46be4b01a89ca93d3f791343f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class C1: | |
def __init__(self, obj): | |
self.obj = obj | |
def __getattr__(self, name): | |
if hasattr(self.obj, name): | |
return getattr(self.obj, name) | |
def t1(self): | |
print(5) | |
class A: | |
def t2(self): | |
print(4) | |
def t1(self): | |
print(7) | |
c = C1(A()) | |
c.t1() | |
c.t2() # Откуда бы линтеру знать, что у C1 есть метод t2? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment