[Zope-dev] Re: [Zope3-dev] ZConfig: Keytype and section type extension

Barry Warsaw barry at zope.com
Mon Dec 29 12:09:27 EST 2003


On Mon, 2003-12-29 at 00:28, Fred L. Drake, Jr. wrote:

> ZConfig currently requires that derived section types not specify a
> "keytype" attribute, used to change the interpretation of the keys.
> The intent is to ensure that keys defined in the base section type
> will still be recognized and associated with the same (or equivalent)
> settings for the derived type.
> 
> In most cases, this is reasonable behavior.  Unfortunately, it makes
> it tedious to specialize general base section types in some cases.  Of
> particular interest is the case of section types that define no
> specific keys, but accept arbitrary keys using
> 
>     <key name="+" attribute="some_mapping"/>
> 
> For such cases, it can be desirable to change what keys are inserted
> into the mapping by changing the keytype of the encosing section type.
> 
> Allowing keytype overrides would not affect any existing schema, since
> such schema are currently rejected.

Since I didn't understand what keytype actually provided, even after
reading the docs on it several times, I've never found a need for it
<wink>.

Even with the above, I'm still not 100% sure what specifying keytypes
does for me, or why or when I'd want to use it.  On the face of the
above, if it makes it easier to use generalize base section types, then
it might be a good idea.

-Barry





More information about the Zope-Dev mailing list