Re: [Python-Dev] PEP Proposal: Revised slice objects & lists use slice objects as indexes

2008-03-10 Thread Forrest Voight
> I am not sure what you are trying to propose here. The slice object > isn't special, it's just a regular built-in type. The idea is to have slice objects be generators. You could make a slice like 1:10:2 , and that would make a slice object which could be used as a list index. The list woul

[Python-Dev] PEP Proposal: Revised slice objects & lists use slice objects as indexes

2008-03-09 Thread Forrest Voight
gt;>> 1:5 + 15:17 1:5 + 15:17 >>> range(30)[1:5 + 15:17] [1, 2, 3, 4, 15, 16] >>> range(100)[[1,2,3]] [1, 2, 3] >>> range(100)[1,2,5] # maybe [1, 2, 5] >>> for x in :15:3: print x # maybe 0 3 6 9 12 --- Forrest Voight __