Ben Finney wrote:
Subject:
Re: built in list generator?
From:
Ben Finney <[EMAIL PROTECTED]>
Date:
Wed, 14 May 2008 09:43:43 +1000
To:
python-list@python.org
To:
python-list@python.org
Newsgroups:
comp.lang.python
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes:
globalrev schrieb:
if i want a list with all numbers between x and y is there a way to
do this with an inbult function.
i mean i can always construct a function to do this but is there
soemthing like:
nbrs = list(range(50,100, 2))
range *does* that. use xrange if all you want is to iterate.
Until Python 3.0, where 'range' returns an iterable.
Is there a thread somewhere of the discussion for this change? I'm
presuming range is used almost exclusively in loops where a change in
the return type would have no negative effect.
--
Ethan
--
http://mail.python.org/mailman/listinfo/python-list