built in list generator?
Andrii V. Mishkovskyi
mishok13 at gmail.com
Wed May 14 13:09:20 EDT 2008
2008/5/14 Ethan Furman <efurman at admailinc.com>:
>
> Ben Finney wrote:
>
>
> Subject: Re: built in list generator?
>
> From: Ben Finney <bignose+hates-spam at benfinney.id.au>
>
> Date: Wed, 14 May 2008 09:43:43 +1000
>
> To: python-list at python.org
>
> To: python-list at python.org
>
> Newsgroups: comp.lang.python
>
> "Diez B. Roggisch" <deets at nospam.web.de> 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.
> --
http://mail.python.org/pipermail/python-dev/2003-April/034534.html
> Ethan
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Wbr, Andrii Mishkovskyi.
He's got a heart of a little child, and he keeps it in a jar on his desk.
More information about the Python-list
mailing list