Chris Withers wrote at 2008-9-1 16:23 +0100:
> ...
>>    auth = IAuthentication()                                 # utility
>>    auth = IAuthentication(default=None)
>>    langs = IUserPreferredLanguages(request)                 # adapter
>>    langs = IUserPreferredLanguages(request, default=None)
>>    view = IBrowserPage((obj, request), name='index')        # named  
>> multi-adapter
>
>Right, but how do you differentiate adapting a tuple to IBrowserPage 
>versus adapting obj and request together to IBrowserPage?

One way would be to use "*objs" in the "Interface.__call__" signature.
Then, multi-adaptation could be "I(obj1, obj2, ...)" and
tuple adaptation "I((obj1, obj2, ...)).
Of course, all other parameters would need to be keyword parameters
(a good thing).

Do you have a serious use case for tuple adaptation?



-- 
Dieter
_______________________________________________
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