[Zope-dev] Interfaces vs ZCA concepts
Martijn Faassen
faassen at startifact.com
Thu Dec 17 06:56:53 EST 2009
Hey,
Tres Seaver wrote:
[snip]
> - -1 to any docstring / exception method which points outside the
> zope.itnerface package. There is a perfectly reasonable "default"
> implementation anyway (in the absence of any hooks):
You're against a docstring talking about zope.component overriding
these? Seriously? I mean, just mentioning zope.component in the
docstring is taboo?
Now as to the default behavior of these methods:
> - - IFoo.adapt(context) raises LookupError, unless the context
> provides IFoo, in which case it returns context.
>
> - - IFoo.adapt(context, default=default) returns default unless context
> provides IFoo, in which case it returns context.
>
> - - IFoo.utility() raises LookupError.
>
> - - IFoo.utility(default=default) returns default
Basically the default behavior of the methods would be like nothing ever
got registered. That looks reasonable to me, +1.
> I would much rather keep a "hook registration" API in the interface
> class for these methods than obscure their origin semantics via a monkey
> patch.
Okay, I guess that does make sense.
Regards,
Martijn
More information about the Zope-Dev
mailing list