Re: improving the utility and adapter lookup APIs

Wolfgang Schnerring <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
* On Nov 25, 2009, at 11:17 AM, Thomas Lotze wrote:
> > What about a simple and consistent API for all components including
> > utilities, adapters and multiadapters:
> >
> > IFoo()
> > IFoo(x)
> > IFoo(x, y)

I quite like the simplicity of this spelling, so I want to be sure
*why* it must be ruled out. (...or does it, really?)

I'm thinking that this...

* Martijn Faassen <[email protected]> [2009-11-25 22:21]:
> The last one won't work if we want to maintain backwards compatibility. 
> The second argument is the default.

is a valid argument, while this...

* Tres Seaver <[email protected]> [2009-11-25 13:34]:
> You can't use an arbitrary number of positional arguments for the
> contexts, because we need to support the named / default cases too.

is not, as evidenced by...

* Fabio Tranchitella <[email protected]> [2009-11-25 20:51]:
>     IFoo(x, y, default=None, name='something')

or am I missing something here?

So I'm thinking, there is no technical reason that prevents Thomas'
spelling, and I'm wondering, do we really have to preserve backwards
compatibility for this case?

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