[Zope3-Users] Adapting a builtin?

Martijn Faassen faassen at infrae.com
Thu Dec 8 11:20:04 EST 2005


Jim Fulton wrote:
> It is valid both to:
> 
> - Declare an interface for a built-in type and
>   register adapters for that interface, and to
> 
> - Register adapters for builtin types directly.
> 
> I can't promise that this works now, but it ought to work.
> I'm 90% sure that it does in fact work, at least in Zope 3.

If exceptions are counted as built-ins, it certainly does work -- the 
interface package registers interfaces for the built-in Python 
exceptions and the Zope 3 framework relies on it for error pages. I 
ported this functionality to Zope 2 (in experimental code, FiveException 
  on the z3 base), and it works there too. :)

Regards,

Martijn



More information about the Zope3-users mailing list