[Zope3-dev] interface conventions: default=_RAISE_ERROR
Guido van Rossum
guido@python.org
Fri, 10 May 2002 20:26:57 -0400
> > in the __init__ of the Interfaces package. An interface that wants to use
> > the default marker would simply
> > from Interface import Interface, _RAISE_ERROR
> > and implementations could import from their interfaces or from the original
> > declaration in the Interface package.
>
> I really wouldn't bother. It saves very little typing, adds to the
> complexity of finding out what things really mean, adds another
> dependency, and saves a few hundred bytes at most per runtime.
While we're at it, I don't particularly like the pattern. If it is
used I think there should be a *public* value so that a caller can be
explicit about "I want the exception" rather than having to use a
short argument list.
Where this is used, would it be acceptable if the exception itself
(KeyError?) was specified as the default value? Or is an exception a
valid regular default?
--Guido van Rossum (home page: http://www.python.org/~guido/)