has_method
From: Gandalf (gandalf_at_geochemsource.com)
Date: 08/31/04
- Next message: Batista, Facundo: "RE: has_method"
- Previous message: Paul Morrow: "Re: Are decorators really that different from metaclasses..."
- Next in thread: Batista, Facundo: "RE: has_method"
- Maybe reply: Batista, Facundo: "RE: has_method"
- Reply: Steve Holden: "Re: has_method"
- Reply: Peter Hansen: "Re: has_method"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 31 Aug 2004 15:13:23 +0200 To: python-list@python.org
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
- Next message: Batista, Facundo: "RE: has_method"
- Previous message: Paul Morrow: "Re: Are decorators really that different from metaclasses..."
- Next in thread: Batista, Facundo: "RE: has_method"
- Maybe reply: Batista, Facundo: "RE: has_method"
- Reply: Steve Holden: "Re: has_method"
- Reply: Peter Hansen: "Re: has_method"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]