PEP 284, Integer for-loops

Bjorn Pettersen BPettersen at NAREX.com
Thu Mar 7 11:20:15 EST 2002


> From: John Machin [mailto:sjmachin at lexicon.net] 
> 
> "Bjorn Pettersen" <BPettersen at NAREX.com> wrote in message 
> news:<mailman.1015439892.7298.python-list at python.org>...
> > > From: David Eppstein [mailto:eppstein at ics.uci.edu]
> > > Subject: PEP 284, Integer for-loops
> > 
> > Thanks for writing the PEP.
> > 
> > I see this as a general proposal for a range syntax, and I disagree 
> > with it because:
> > 
[snip]
> > 
> >   - I would like range objects to be first class, ie. I would want
> >     to be able to pass ranges to functions, return them from 
> >     functions, and do all the other things one can do with first
> >     class objects.
> 
> I don't understand this. range and xrange *are* first-class 
> objects. You can do all of those things.

Yes, but this new syntax is proposing itself to be *the* way of creating
a range to iterate over. If it can only be used in one context in the
language I'm left to wonder if it's not just extra "noise" for everyone
to have to learn...

-- bjorn




More information about the Python-list mailing list