[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

list of attributes

Ken Seehart

3/8/2008 6:58:00 AM

I have a class with a __getattr__ method that returns various methods.
I also have the ability to determine the list of method names that are
supported by my __getattr__ method (this list would be dynamically
generated as it depends on the current state).

What I would like to know is if there is a way overload the behavior of
dir(instance) to include this dynamically generated list of method
names. Ideally this would have the effect of making these methods
visible to the autocomplete feature of debuggers in most modern IDEs.

It looks like this would be __dir__ in 2.6, is that right?

Ken