PEP 260: simplify xrange()

Michael Hudson mwh at python.net
Wed Jun 27 19:05:57 CEST 2001


Dinu Gherman <gherman at darwin.in-berlin.de> writes:

> Aahz Maruch wrote:
> > 
> > >PS: BTW, why not *add* something useful and make float
> > >    increments work "as expected" in range/xrange...?
> > 
> > And how do you expect floating point increments to work?  (Have you paid
> > any attention to the extensive threads on FP over the past few months?)
> 
> No, I haven't followed the discussion... but you asked 
> about an implementation; I'm using the one below.
> 

>>> len(frange(0,1.,0.1))
11
>>> len(frange(0,1.,0.2))
5

Cheers,
M.

-- 
  I have gathered a posie of other men's flowers, and nothing but
  the thread that binds them is my own.                   -- Montaigne



More information about the Python-list mailing list