[Zope-dev] Interfaces vs ZCA concepts
Martijn Faassen
faassen at startifact.com
Sat Dec 19 08:23:57 EST 2009
Tres Seaver wrote:
[snip]
> If __call__ is an API, why is it not documented where the rest of the
> API for Interface is specified?
I think you shouldn't focus on documentation to the exclusion of the
practical situation, which is that people have been calling interfaces
for many years now to accomplish adaptation, apparently having found
about it from a multitude of sources. It has gained C optimizations.
The practicality of this is that this is a well-known and well-used API.
What we should fix is its documentation in interfaces.py.
A little bit of googling even found a definition in Twisted that says:
# FIXME: deprecate attribute somehow?
CannotAdapt = TypeError
though I cannot find many examples of using TypeError or CannotAdapt to
handle adaptation.
I cannot tell why it is not in interfaces.py. Perhaps a plain and simple
oversight? Perhaps it was initially felt to be experimental, but became
accepted (gaining C optimizations, and a mention in README.txt), and it
was forgotten to add it to the interfaces documentation? Maybe Jim knows. :)
Regards,
Martijn
More information about the Zope-Dev
mailing list