Re: curious about slice behaviour

2005-09-05 Thread Stephan Diehl
On Mon, 05 Sep 2005 14:26:14 -0400, Terry Reedy wrote: > > "Stephan Diehl" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >>I just found out by accident, that slice indices can be larger than >> the length of the object. For example > 'test'[:50] >> 'test' [...] >> Does anybod

Re: curious about slice behaviour

2005-09-05 Thread Terry Reedy
"Stephan Diehl" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I just found out by accident, that slice indices can be larger than > the length of the object. For example 'test'[:50] > 'test' 'test'[40:50] > '' > I'd rather expected to be confronted with an IndexError. > (

curious about slice behaviour

2005-09-05 Thread Stephan Diehl
I just found out by accident, that slice indices can be larger than the length of the object. For example >>> 'test'[:50] 'test' >>> 'test'[40:50] '' I'd rather expected to be confronted with an IndexError. (This is actually described in http://docs.python.org/lib/typesseq.html, so my expectation