a possibly foolish question about slices
Eddie Corns
eddie at holyrood.ed.ac.uk
Fri Jun 14 15:09:45 EDT 2002
martin at v.loewis.de (Martin v. Loewis) writes:
>eddie at holyrood.ed.ac.uk (Eddie Corns) writes:
>> It frequently bugs me that you can't supply any number for b in <string>[a:b]
>> to indicate spanning to the end of the string.
>[...]
>> So if the designers could fix this for version 2.3 I think we'll all be happy
>> :)
>Let me introduce Guido's time machine: you can always use sys.maxint
>as the value of b.
Hmm, I was actually trying to suggest (non-seriously) fixing zero based
indexing! but I realise now that wasn't clear.
I never noticed using maxint, now we can say [p:p+n or sys.maxint] Hurrah!
Eddie
More information about the Python-list
mailing list