[Python-Dev] Single- vs. Multi-pass iterability

Barry A. Warsaw barry@zope.com
Mon, 15 Jul 2002 19:46:08 -0400


>>>>> "AM" == Alex Martelli <aleax@aleax.it> writes:

    >> what Zope does AFAIK).  Otherwise creating minor variations on
    >> a class would be quite a pain -- you'd have to repeat all the
    >> interfaces implemented by the base class; and what if a later
    >> version of Super implements more interfaces?

    AM> This is actually a difficult point.  If I have to explicitly
    AM> state all the interfaces of Super that I want to _exclude_,
    AM> and Super adds some more interfaces tomorrow, then it's quite
    AM> possible that my class is suddenly broken -- it doesn't
    AM> guarantee the invariants that says it guarantees, any more --
    AM> and I don't even know about it.

You'd need a way to explicitly state that you implement /none/ of the
interfaces of your superclass, and then explicitly add back the ones
you do implement.

-Barry