In the function __getattr__(), if a referred variable is not found then it gives an error. How can I check to see if a variable or method exists as part of an objec
__getattr__()
Check if class has such method?
hasattr(Dynamo, key) and callable(getattr(Dynamo, key))
or
hasattr(Dynamo, 'mymethod') and callable(getattr(Dynamo, 'mymethod'))
You can use self.__class__ instead of Dynamo
self.__class__
Dynamo