On 2006-06-23, Filip Wasilewski <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > >> Logically, I should be able to enter x[-2:-0] to get the last and next to >> last characters. However, since Python doesn't distinguish between positive >> and negative zero, this doesn't work. Instead, I have to enter x[-2:]. > > Hooray! Logically there is no such thing as positive or negative zero, > or did I miss something in the primary? > > PS. x[len(x)-2 : len(x)-0]
This seems to defeat the purpose of allowing negative indexes. My understanding was that negative indexes were introduced to avoid things like seq[len(seq) - i] -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list