Re: improving the utility and adapter lookup APIs

Thomas Lotze <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
Martijn Faassen wrote:

> Thomas Lotze wrote:
> [snip]
>> What about a simple and consistent API for all components including
>> utilities, adapters and multiadapters:
>> 
>> IFoo()
>> IFoo(x)
>> IFoo(x, y)
> 
> The last one won't work if we want to maintain backwards compatibility. 
> The second argument is the default.

Technically, that's obvious. I guess I meant to say "How about..." then.
You didn't explicitly mention the subject of backwards compatibility in
your original message, so let's make it explicit now: Is backwards
compatibility a goal in this discussion?

If it isn't, I'm rather against an API that interprets an argument to
IFoo() as meaning different things depending on whether it's a tuple or
not. Python itself has an API that works like this (string formatting) and
is moving away from it. Requiring the default to be specified as a named
argument would also help readability IMO.

-- 
Thomas



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