[Python-3000] Builtin iterator type
Greg Ewing
greg.ewing at canterbury.ac.nz
Thu Nov 16 02:09:51 CET 2006
George Sakkis wrote:
> class Container(object):
>
> class Sequence(Container):
> class Mapping(Container):
>
> Note that this does _not_ disallow duck typing; anyone is perfectly
> free to define a method len() in a class that does not extend any of
> the above so that a client can call x.len() successfully.
What's the point, then? What benefit do I get from
extending Sequence if I can achieve the same thing
without bothering?
--
Greg
More information about the Python-3000
mailing list