[Zope-dev] component registry navelgazing

Chris Withers chris at simplistix.co.uk
Mon Jun 13 11:01:57 EDT 2011


On 13/06/2011 15:26, Charlie Clark wrote:
>> In order to get the object itself back from such an adaptation, you need
>> to use the default= argument.
>
> I know that the question has been answered but your question makes me ask
> another: why would you want to adapt an object with itself?

I have something, I want something that implements IWhatever.

Now, it may well be that something implements IWhatever, but it may also 
not. As the author of the code in question, I don't want to have to care.

Other authors can plug in adapters for the cases where something doesn't 
implement IWhatever ;-)

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk


More information about the Zope-Dev mailing list