min() & max() functionality

Paul-Michael Agapow p.agapow at ic.ac.uk
Fri Sep 1 13:08:23 EDT 2000


Perhaps I've missed it in the documentation, but what does a hand-rolled
sequence (i.e. my own class) need, so it can be used by min() and max()?

I've implemented just about all the mutable sequence functionality in my
own class (although it seems reasonable that only __len__() and
__getitem__() would be be necessary) but calling either min or max on it
sends Python into an infinite albeit interruptable loop. (Possibly
relevant platform details: MacOS 9.04, Python IDE 1.52c1.)

Ideas?


-- 
Paul-Michael Agapow (p.agapow at ic.ac.uk), Biology, Imperial College
"Pikachu's special power is that he is monophyletic with lagomorphs ..."



More information about the Python-list mailing list