Seek support for new slice syntax PEP.

Colin W. cjwilliams43 at gmail.com
Wed Dec 16 20:00:05 EST 2009


On 16-Dec-09 19:23 PM, Gregory Ewing wrote:
> Terry Reedy wrote:
>> So it would be MUCH more useful if that notation created a range object.
>>
>> for i in [1:n]: ...
>>
>> So I would oppose the slice proposal in favor of a range proposal.
>
> Another possibility would be to unify range and slice
> objects so that they're actually the same thing. Then
> the same notation could be used for both purposes.
>
This would be good if the increment could also be handled.

Terry Reedy suggested:-  for i in [1:n]: ...

Are the brackets really needed?

Colin W.



More information about the Python-list mailing list