Fix Python – How to check whether a method exists in Python?
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 object?
import string
import logging
class Dynamo:
def __init__(self,x):
print “In Init def”
self.x=x
def __repr__(self):
print self.x
def __str__(self):
print self.x
def __int_….