On Sun, Feb 1, 2015 at 10:51 PM, Greg Ewing firstname.lastname@example.org wrote:
Although slices and ranges are used for different things and implemented differently, conceptually they are similar: they define an integer sequence with a start, stop, and step size.
They behave differently in some ways, though. Consider:
[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
x = list(range(10)) x
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Would your proposed slice-ranges behave like slices or ranges in this situation? And how will people remember which?
Since this is really a literal for making ranges, I would say the range syntax would be the correct one.
As I replied to Steven, let's forget the idea that slices and ranges are the same. I was mistaken about that. Let's just call this a range literal. It has some features similar to slices, but not all.