Re: improving the utility and adapter lookup APIs

Christian Theune <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
On 11/25/2009 08:51 PM, Fabio Tranchitella wrote:
> * 2009-11-25 19:35, Tres Seaver wrote:
>>>> IFoo()
>>>> IFoo(x)
>>>> IFoo(x, y)
>>
>> You can't use an arbitrary number of positional arguments for the
>> contexts, because we need to support the named / default cases too.
>
> I'm probably saying something very stupid... What's wrong with the it?
> Can't we define something like:
>
>      def __call__(self, *args, **kw):
>          ....
>
> to get a multi adapter in this way?
>
>      IFoo(x, y, default=None, name='something')

That's what I thought of as well. The __call__ signature isn't as 
expressive as before with that but I'm relatively sure it's a valid 
implementation of Thomas' suggestions.

Tres?

-- 
Christian Theune · [email protected]
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 0 · fax +49 345 1229889 1
Zope and Plone consulting and development

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