[Tutor] Silly Object Namespace Questions
D-Man
dsh8290@rit.edu
Fri, 25 May 2001 09:39:20 -0400
On Fri, May 25, 2001 at 01:29:40AM +0200, Kalle Svensson wrote:
| Sez D-Man:
| > On Thu, May 24, 2001 at 09:41:35AM -0700, Sean 'Shaleh' Perry wrote:
| > | On 24-May-2001 Curtis Larsen wrote:
| > | > 6. What function(s) can I use to see/list methods such as "doit" within
| > | > an instance? ("vars()" and "dir()" don't do it.)
| >
| > instance = object1()
| > dir( instance.__class__ )
| >
| >
| > Notice that instead of passing the instance to the dir funtion I
| > passed the class object.
|
| Even this won't be enough if the class has inherited methods from
| superclasses, though. For that situation, you'll need something like this
You're right -- it isn't recursive. One would need to traverse the
entire inheritance heirarchy to get _all_ methods.
-D