Hi!

> Handling N > len(a) except when "a" happens to be 0 seems a bit
> counterintuitive.

No: Let's assume, that you have an empty list a. Then M in a[M:N] is
always out of bounds, which should produce an error. Analogously, if a
is not empty, but M > len(a), an error should be produced, too. (BTW, is
an error produced in this case at the moment?)

And my opinion is, that an error should be produced, too, if N > len(a)
and a is not 0. A programmer should take care of the bounds. If an index
is out of bounds, I consider it as wrong not to produce an error. But
this is, as I have said already, just my humble opinion.

The following situation would be different: If M were the starting point
and N the number of items, one could say, that a[M:N] should return at
most N items starting with the M'th item.

Just my 2 cents.

Best wishes,
Georg






                
___________________________________________________________ 24 FIFA World Cup tickets to be won with Yahoo! Mail http://uk.mail.yahoo.com

Reply via email to