[PATCH] A compromise on case - another suggestion

Peter Schneider-Kamp petersc at stud.ntnu.no
Sat May 27 23:57:01 EDT 2000


Andrew Dalke wrote:
> 
> The IndexError check is also used to signify the end of the list, as in:

Is that really so? From a quick look at the relevant sources I saw
at least some places where IndexError is checked. So you may be right.

But does it have to be like that? Can't we use the length of the list
to check?

> BTW, the failure goes from O(1) to O(N) because it has to check
> every available value.  I don't know internals well enough to know
> if getattr() is also affected by the patch - it shouldn't be.  That
> would leave an O(1) test available.

I don't understand this part. I would think printing the range
is O(1).

liking-more-explicit-error-messages-very-much-ly y'rs
Peter
--
Peter Schneider-Kamp          ++47-7388-7331
Herman Krags veg 51-11        mailto:peter at schneider-kamp.de
N-7050 Trondheim              http://schneider-kamp.de




More information about the Python-list mailing list