--- On Wed, 1/27/10, Virgil Dupras <hs...@hardcoded.net> wrote:
> 
> Why is this thread still going? It seems to me that the
> case for this
> change is very weak. Lists, like dicts and tuples, are
> used
> *everywhere* and in *vast* quantities. Making them grow by
> 4 or 8
> bytes each for such a corner case can't be an option.
> 
> I'm sure your new list class has a lot of uses, but it
> should be an
> external class. If it stays close in behavior to the lists'
> behavior,
> then we could even add a notice in pop()'s documentation
> that
> recommends to use your new class in case they want a
> painless way to
> replace list usage (to make the life of those poor
> developers
> maintaining other people's code easier), maybe even add it
> in stdlib's
> "collections" unit.
> 


Lists are indeed used *everywhere* and *vast* quantities, which is why 
optimizations on list operations are worthwhile to pursue.

The particular optimization makes a few tradeoffs, and the consensus here 
appears to be that the ugliest tradeoff is adding the pointer to PyListObject.

There is at least some irony in opposing an optimization to a remove() 
operation on the basis of compacting memory, which isn't to say that the 
argument isn't valid.

There is also the possibility that my initial patch can be refined by somebody 
smarter than myself to eliminate the particular tradeoff.  In fact, Antoine 
Pitrou already suggested an approach, although I agree that it kind of pushes 
the boundary of sanity. :)



_______________________________________________
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