[Python-3000] iostack and Oh Oh

Bill Janssen janssen at parc.com
Fri Dec 1 20:12:11 CET 2006


Samuele Pedroni writes:
> Also the built-in types are concrete types, which tend to maximize  
> convenience. It's unclear
> that they are a good starting point to define interfaces, because of 
> this maximality.

I agree with you on this, Samuele.  I don't want to deep-end, and put
only one method in each interface, but I think the standard types
could be decomposed a bit.  I've tried to do this with my list (which,
by the way, feel free to fiddle with -- that's why it's a Wiki page) at
http://wiki.python.org/moin/AbstractBaseClasses.  You'll note that the
"list" type is constructed of six interfaces: Comparable, Object,
Container, MutableContainer, Sequence, and MutableSequence.  (Though
the inheritance hierarchy makes this easier to think about.)  And the
"file" object is broken into nine base interfaces.  My thinking (about
"file") is that in Py3 the actual file type might be
implementation-dependent, and in fact there might be several of them,
each of which would mix together a different set of file interfaces.
I think a similar decomposition would apply to Mapping; I just don't
have a good idea of what it would be (yet).

Bill


More information about the Python-3000 mailing list