Chris Withers wrote:
>  From a user's perspective, this makes no sense:
> 
>  >>> from zope.interface import implements,Interface
>  >>> from zope.component import queryAdapter
>  >>> class ISomething(Interface): pass
> ...
>  >>> class MyClass: implements(ISomething)
> ...
>  >>> m = MyClass()
> 
> Right, so this does make sense:
> 
>  >>> ISomething(m)
> <__main__.MyClass instance at 0x00BED6E8>
> 
> This does not:
>  >>> repr(queryAdapter(m,ISomething))
> 'None'

Looks like a bug to me.  If the object passed as the first argument to 
queryAdapter() implements the interface passed as the second argument, I 
believe queryAdapter() should return the object, regardless of any 
component registrations.

Shane

_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to