How Python works: What do you know about support for negative indices?

Ben Finney ben+python at benfinney.id.au
Thu Sep 9 22:21:40 EDT 2010


Raymond Hettinger <python at rcn.com> writes:

> It doesn't seem to be common knowledge when and how a[x] gets
> translated to a[x+len(x)].  So, here's a short info post on how Python
> supports negative indices for sequences.

Thanks for this. Could you post your messages using a channel that
doesn't arbitrarily split your paragraphs into long-short-long-short
lines? It makes paragraphs burdensome to read, and I skipped most of the
message because of that.

I encourage anyone whose messages are munged like that to seek
correction from their mail service provider, and switch to a different
one until it's fixed.

-- 
 \     “Oh, I realize it's a penny here and a penny there, but look at |
  `\      me: I've worked myself up from nothing to a state of extreme |
_o__)                                          poverty.” —Groucho Marx |
Ben Finney



More information about the Python-list mailing list