[Zope3-dev] interface conventions: default=_RAISE_ERROR

Gary Poster garyposter@earthlink.net
Sun, 12 May 2002 00:00:04 -0400


On Saturday 11 May 2002 07:21 pm, Tres Seaver wrote:
> On Fri, 2002-05-10 at 20:19, Gary Poster wrote:
> > My argument is for gracefulness, and perhaps for some small reduction in
> > fragility.  I think it is clunky, for instance, for the placeful
> > component architecture functions to have to check for their own default
> > marker interface and then translate their default marker interface to the
> > particular service default marker interface, if found.  If you do not
> > agree with my suggestion, the placeful component architecture functions
> > have to import the individual markers for each of the services at the top
> > of the module, the coder has to make sure that the correct service marker
> > is substituted for the placeful CA marker, and all of a suden you are
> > talking about a lot of fluff code that just swaps some objects around. 
> > Why?
>
> I would say that clients should *never* explicitly pass the "faux"
> default argument ('_marker', or whatever) into a function which uses it
> to declare such a semantic;  the whole point of it is to signal what
> happens when nothing is passed!  If its name is '_RAISE_ERROR', then
> it should raise without calling any other underlying function at all,
> obviating the need to propagate it.

Yes, you're right; that was a flaw in my argument that essentially negates 
it.  I could still quibble, but it wouldn't be productive.

That said, I personally now prefer the readability of default=NotFoundError 
(or whatever error) as Guido suggested (even while he generally disliked the 
convention, as Martijn pointed out).

Tres, should I construe your position as the official ZC position, and remove 
my Guido-inspired approach from my sandbox, returning to the marker?  Or 
follow some other course of action?  I have an opinion, which I've stated, 
but beyond that I have zero interest in debating this issue further: I'd 
rather just have a community consensus or a papal/ZC directive, and move on.

Thanks

Gary