Understanding pythons reverse slice ( [::-1] )
问题 I always thought that omitting arguments in the python slice operation would result into: start = 0 end = len(lst) step = 1 That holds true if the step is positive, but as soon as the step is negative, like in the "reverse slice" [::-1] , omitting start/end results in: start = len(lst)-1 end = None Is this a special case, or am I missing something? 回答1: The default is always None ; it is up to the type to determine how to handle None for any of the 3 values. The list object is simply passed a