Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Antoon Pardon wrote: > > > I need this Top value in > > a context where it can be used as a start or stop value > > in a slice. > > But the only valid values allowed for indices are 0 up to the length of the > array inclusive. Larger integers are not allowed, so why should Top be > allowed?
Larger integers are not allowed as subscripts, but slicing is more tolerant: | >>> array = ['a', 'b', 'c'] | >>> array[:1] | ['a'] | >>> array[:2] | ['a', 'b'] | >>> array[:3] | ['a', 'b', 'c'] | >>> array[:4] | ['a', 'b', 'c'] | >>> array[:987654321] | ['a', 'b', 'c'] BTW, negative subscripts are allowed, too; see e.g. http://docs.python.org/tut/node5.html#SECTION005140000000000000000 HTH, John -- http://mail.python.org/mailman/listinfo/python-list