Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > list of attributes

Reply
Thread Tools

list of attributes

 
 
Ken
Guest
Posts: n/a
 
      03-08-2008
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
data attributes override method attributes? Jayden Python 16 09-29-2012 03:20 AM
attributes ala java annotations or .Net attributes? Kyle Schmitt Ruby 3 07-24-2007 07:48 PM
class attributes & data attributes james_027 Python 2 06-20-2007 03:12 PM
WebControl.Attributes.Add and custom attributes P4trykx ASP .Net 2 01-31-2007 04:33 PM
Parse reserved attributes as normal attributes Max XML 1 09-22-2006 12:04 PM



Advertisments