Re: component registry navelgazing

"Charlie Clark" <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Organization Clark Consulting & Research
Message-ID <[email protected]>
Hiya,

Am 12.06.2011, 22:48 Uhr, schrieb Chris McDonough <[email protected]>:

>>>> from zope.component.registry import Components
>>>> c = Components()
>>>> from zope.interface import Interface, implements
>>>> class IFoo(Interface): pass
> ...
>>>> class Foo(object):
> ...     implements(IFoo)
> ...
>>>> foo = Foo()
>>>> c.queryAdapter(IFoo, foo)
> <None>

> 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?

Charlie
-- 
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
_______________________________________________
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.