typetesting, adaptation, typeclasses, ... (was Re: isinstance() considered harmful)
Kragen Sitaker
kragen at pobox.com
Sun Jan 27 23:00:46 EST 2002
"Jason Orendorff" <jason at jorendorff.com> writes:
> > In MetaPy.Sugar.Sequence, I define everything in terms of
> > simple_getitem, simple_setitem, simple_delitem, insert, and __len__.
> > [...]
> > append is defined in terms of extend [...]
>
> Wouldn't this be better?
>
> def append(self, obj):
> self.insert(self.__len__(), obj)
Maybe so. I can't really imagine a case where it would be noticeably
worse.
More information about the Python-list
mailing list