built in list generator?

Ethan Furman efurman at admailinc.com
Wed May 14 13:17:00 EDT 2008


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.
--
Ethan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080514/461751fd/attachment-0001.html>


More information about the Python-list mailing list