G
Gandalf
Hi All!
Does anyone knows how to tell if an object has a method with a given
name? How can I access that method?
For attributes, it is easy:
class A(object):
a = 12
b = 'Python'
a = A()
a.__dict__.has_key('a') # True
a.__dict__.has_key('b') # True
a.__dict__.has_key('c') # False
But it won't work for methods. Thanks in advance.
Laci 2.0
Does anyone knows how to tell if an object has a method with a given
name? How can I access that method?
For attributes, it is easy:
class A(object):
a = 12
b = 'Python'
a = A()
a.__dict__.has_key('a') # True
a.__dict__.has_key('b') # True
a.__dict__.has_key('c') # False
But it won't work for methods. Thanks in advance.
Laci 2.0