>> 
>> Ah, but that applies for *large* lists. Adding 8 bytes to
>> each list
>> object applies to *all* lists. I betcha that many programs
>> use many
>> tiny lists.
>> 
> 
> Even most tiny-ish lists are wasting memory, though, according to this 
> sequence:
> 
> 4, 8, 16, 25, ...
> 


That is only is they are being grown with list.append().
Otherwise, list sizes are exact.  For example, [0,1,2]
uses space for just three entries and [] for none.

I get the impression that 1) you've already made up your
mind and are ignoring input from the other developers, 
2) that you're ignoring the python-dev discussions of long ago 
where this very idea was rejected and deques came in to
being instead, 3) over-estimating the prevalence of use
cases for pop(0), and 4) under-estimating the impact on
small lists, 5) under-estimating the impact on psyco or
other implementations of Python, 6) under-estimating the
impact on third-party extensions and debugging tools.

Deques already provide a solution to the FIFO problem
and they do so without huge wastes of memory or calls
to memmove().  They handle both insertion and deletion
from the front and back.  In comparison, the proposed
changes to lists seem like a complete hack.  Just because
it can be done, doesn't mean that it should.

ISTM that you're attacking an already solved problem
and that you're playing fast and loose with a core data
structure.


Raymond

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to