class object def __getattr__ self attr if attr startswith something_ r

1
2
3
4
5
6
7
8
9
class A(object):
def __getattr__(self, attr):
if attr.startswith("something_"):
return "hello " + attr
super(A, self).__getattribute__(attr)
vasya = "shmulik"
obj = A()