Hiya,

Am 12.06.2011, 22:48 Uhr, schrieb Chris McDonough <chr...@plope.com>:

>>>> 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  -  Zope-Dev@zope.org
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 )

Reply via email to