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
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