[Zope3-dev] more on _clear and the directives registry structure

Steve Alexander steve@cat-box.net
Tue, 17 Sep 2002 13:49:16 +0000


> At this point subs has to be a subdirective tuple or (if the
> structure used by _clear is valid) a dict.  It seems like the
> code expects a dict normally, because there are comments that say
> "this is crufty.  if this is a tuple, it means we created it
> as such in registersub...."

I think I added those comments.
I did some work on this stuff when I needed to refine the semantics of 
the "package" attribute in zcml, and the two different cases of what to 
do if there is no "package" attribute.

The choice was between some minor cruft here, or a major refactoring.
I chatted with Jim about this, and we decided on the minor cruft, as it 
was really just an implementation detail.


> Now, as far as I can tell, registersub is the normal way
> of doing things and only _clear uses the the "other way".
> Can we uncruftify this this by fixing _clear and removing the
> tuple check, knowing that we are going to get passed a tuple?
> Of course, as I said in a previous note, I'd like to reorder
> the tuple, too, but that was a separate question <grin>.

--
Steve Alexander