PEP 284, Integer for-loops

David Eppstein eppstein at ics.uci.edu
Thu Mar 7 12:30:03 EST 2002


In article <B8ACE2AC.5F91%jonathan at onegoodidea.com>,
 Jonathan Hogg <jonathan at onegoodidea.com> wrote:

> To a new programmer, teaching them
> that 'for' iterates over sequences and that 'range' makes sequences of
> integers is pretty easy (and yes, I used to teach).

That part is easy, yes.  The harder part is explaining multi-parameter 
versions of range.  What I've been resorting to in order to avoid this 
problem is rearranging all my integer loops to only use the 
single-parameter version.



More information about the Python-list mailing list