On Wed, Nov 25, 2009 at 05:17:17PM +0100, Thomas Lotze wrote:
> What about a simple and consistent API for all components including
> utilities, adapters and multiadapters:
> IFoo()
> IFoo(x)
> IFoo(x, y)

This also doesn't allow you to use this (anti?)pattern:

class Foo:


    def do_something(self):
        # custom behaviour here
        default_foo_adapter = getAdapter(self, IFoo)
        return default_foo_adapter.do_something() # fallback to default 

It may not be very theoretically correct, but it's something I find very
useful when writing IPublishTraverse implementing classes for
zope.publisher to traverse over. It saves me from having to inherit from
the default traverser.

Brian Sutherland
Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope )

Reply via email to