opensubscriber
   Find in this group all groups
 
Unknown more information…

i : interface-dev@zope.org 9 July 2009 • 4:32AM -0400

Re: [Interface-dev] ClassProvides vs. inspect.getmembers
by Thomas Lotze

REPLY TO AUTHOR
 
REPLY TO GROUP




Jim Fulton wrote:

> Inspection is already broken.  It isn't at all invalid for a descriptor to
> raise AttributeError. The inspector should not assume that just because
> something is in the class dict, it is an attribute.

Too bad the standard library's inspector does just that.

> If we were going to work around this inspect bug, the way to do it would
> be to find a way to deal with this without a class __provides__ attribute,
> probably by storing the data outside a class. This would be a pain, but
> would be typical of the pain caused by Python's second- class treatment of
> classes.

Sounds like nothing I'd like to tackle if it can be avoided. Far easier to
try and make the client code do something better than assume
inspect.getmember() to work in this use case.

--
Thomas



_______________________________________________
Interface-dev mailing list
Interface-dev@zope...
http://mail.zope.org/mailman/listinfo/interface-dev

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.