Comment 7 for bug 98380

Revision history for this message
Lennart Regebro (regebro-gmail) wrote :

A bit more information:

providedBy will first look for a __providedBy__ attribute. ClassType doesn't have that, so it will then return getObjectSpecification(ob), which in turn returns <zope.interface.declarations.Declaration object ...>

implementedBy will look for an __implements__. If none is provided, it will figure out what the class implements, and set that as __implements__, and also set __providedBy__ to objectSpecificationDescriptor. The next providedBy will now return a <zope.interface.declarations.ClassProvides object ...> instead.

I don't know what The Right Thing is here, but this is only a problem if you want to create an adapter for all classic classes, but not new classes. Which is a rather strange usecase, and is probably the reason why few people encountered this bug.