Re: component registry navelgazing

Chris Withers <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
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
_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.