[Biopython-dev] Python 2.6+ support for __dir__ method

Peter Cock p.j.a.cock at googlemail.com
Thu Aug 29 17:03:24 UTC 2013


Hi all,

I was reading over the list of what's new in Python 2.6 and wondered about this:

> The built-in dir() function now checks for a __dir__() method on the
> objects it receives. This method must return a list of strings containing
> the names of valid attributes for the object, and lets the object control
> the value that dir() produces. Objects that have __getattr__() or
> __getattribute__() methods can use this to advertise pseudo-attributes
> they will honor. (issue 1591665)

http://docs.python.org/2/whatsnew/2.6.html

Does that sound useful for some of our more dynamic objects?

Peter



More information about the Biopython-dev mailing list