python class module __getattr__
use funation obj.val1.val2
error. python program for.
class hub:
def __getattr__(self,__name):
print(__name)
obj = hub()
obj.val1.val2
error:
val1
Traceback (most recent call last):
File "hub.py", line 6, in <module>
obj.val1.val2
AttributeError: 'NoneType' object has no attribute 'val2'
Expert Value:
val1.val2