ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> pypy-dev
pypy-dev
Re: [pypy-dev] range list implementation
by Lenard Lindstrom other posts by this author
Oct 21 2006 4:45PM messages near this date
[pypy-dev] range list implementation | [pypy-dev] py.test distributed
On 21 Oct 2006 at 23:52, Carl Friedrich Bolz wrote:

>  Hi all!
>  
>  Just a few words about the range list implementation I wrote during the
>  last few days (when I was fed up with the config branch...). There is a
>  new list implementation W_RangeListObject. The idea is that calling
>  range will not immediately allocate the whole list but only store start,
>  stop and step into the range list object. The range list object behaves
>  like a perfectly normal list to the user. For some operations the range
>  list is 'forced', that is the full list is generated. This is especially
>  the case for operations that mutate the list. The following operations
>  on the range list keep it in its non-forced memory-saving form:
>  
>   * iteration
>   * len
>   * getitem
>   * getitem with a slice (which returns a new range list)
>   * iter
>   * repr
>   * reverse
>   * sort
>  
Early versions of the xrange type supported slicing. Slicing was dropped from
xrange in Python 2.2. As I recall reading somewhere there just wasn't enough
interest to justify the cost of maintaining the C code. But maybe it makes more
sense when coded in Python.

Lenard Lindstrom
<len-l@[...].net> 


_______________________________________________
pypy-dev@[...].net
http://codespeak.net/mailman/listinfo/pypy-dev
Thread:
Carl Friedrich Bolz
Lenard Lindstrom

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved