News for hackers. Stuff that matters.
Re:Numbering should start at zero: E.W. Dijkstra by UncleEntity on Friday March 21, 2025 @09:21AM (#43435347)
So you're saying a negative index value should work like a count of elements to return and not an index?

Then you couldn't do thing like l[-4:-2] to get a range of elements which seems slightly useful.

Re:Numbering should start at zero: E.W. Dijkstra by pansa2 on Friday March 21, 2025 @09:27AM (#43435403)
No - negative indexing is fine as it is. You just need to be careful about the special case of negative zero.