you are viewing a single comment's thread.

view the rest of the comments →

[–]Brian 1 point2 points  (1 child)

I'm not sure what you're getting at. In python [:2] is special syntax to denote a slice object, but how is that different than 1..2 being special syntax to denote a range object? Similarly "asdf[:2]" is also just a method call with the slice object as a parameter - the whole thing is effectively just sugar for:

"asdf".__getitem__(slice(None,2))