[Zope-dev] improving the utility and adapter lookup APIs

Fabio Tranchitella kobold at kobold.it
Wed Nov 25 14:51:34 EST 2009


* 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')

Best regards,
Fabio


More information about the Zope-Dev mailing list