[Zope3-dev] Re: proposal: replace zope.schema.Sequence with
zope.schema.Collection
Philipp von Weitershausen
philipp at weitershausen.de
Thu Apr 29 09:56:45 EDT 2004
Fred Drake wrote:
> > IMO, Stephan has identified a clear place in which our model could be
> > improved. Rather than merely making ISet not subclass ISequence (and
> > make it just subclass IField, I suppose), I propose that
> >
> > * "Sequence" be renamed to "Collection" (and "ISequence" to
> > "ICollection");
> > * "Collection" include an "ordered=True" keyword argument;
> > * "List" and "Tuple" subclass "Collection" (and same for interfaces)
> > and disallow setting of "ordered" (it must always be True);
> > * "Set" subclass "Collection" (and same for interfaces) and disallow
> > setting of "ordered" (it must always be False); and
> > * (less importantly) "Set" default to creating a Sets.set.
>
> I just spoke with Gary, and am proposing a slight modification of this change:
>
> - Collection is added as a base for Sequence (and ICollection for ISequence)
>
> - Sequence will set ordered=True and disallow changing it
>
> - List and Tuple subclass Sequence
This also makes more sense to me, although this will result in some deep
inheritance chains just for fields. It might confuse people. OTOH, it
just makes sense :)
Philipp
More information about the Zope3-dev
mailing list