[Zope3-dev] interface conventions: default=_RAISE_ERROR

Guido van Rossum guido@python.org
Wed, 15 May 2002 15:27:14 -0400


> I think we're on the right track looking for method pairs.

+1

> Maybe the default and no-default cases should be distinguished by
> the starting verb.  I think getXXX should be like dictionary get, 
> except that we should require a default value argument.

Hm, __getitem__ and getattr also begin with get.  I think defaulting
to None would be convienent and Pythonic.

> I'm not sure verb to use for the no default case.
> 
> Anybody got any ideas?

Alas, no. :-(

> Maybe the no default case should ommit the verb, as in:
> 
>   getRequestDefaultViewName(object, request, default=None)
> 
>   requestDefaultViewName(object, request)

This particular example is confusing because request is also a
verb. ;-)

--Guido van Rossum (home page: http://www.python.org/~guido/)