list of attributes

K

Ken

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top