PEP 276 Simple Iterator for ints (fwd)

Greg Ewing greg at cosc.canterbury.ac.nz
Thu Dec 13 00:17:43 CET 2001


Bengt Richter wrote:
> 
> Then again, you could just spell it out...:
> 
>      for i in slice(0,5,2):
>          ...

You could also define an ints object that would
let you say

  for i in ints[0:5]:
    ...

-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list