On approximately 1/26/2010 1:27 AM, came the following characters from the keyboard of Stefan Behnel:
Michael Foord, 26.01.2010 01:14:
How great is the complication? Making list.pop(0) efficient sounds like
a worthy goal, particularly given that the reason you don't use it is
because you *know* it is inefficient
I agree. Given a programmer the insight that lists are implemented as
arrays in CPython is essentially saying "don't use list.pop(0), it's
SLOW!". So they won't use it, and even avoid it for small lists where it
doesn't really matter. It basically stinks.

Making list.pop(0) fast removes another edge where programmers must
prematurely concentrate on implementation specifics of the interpreter they
use, rather than the functionality they want to implement. I think that's
an improvement to the simplicity that Python provides. It's basically
saying: "care about performance when you have to, but otherwise believe in
the core developers to make your code fast enough in most common cases".

Stefan

Being relatively new to Python, and not yet having discovered deque, I've coded a list.pop(0) just the other day. Guess I better go find that, and see if my usage should be optimized somehow.

--
Glenn -- http://nevcal.com/
===========================
A protocol is complete when there is nothing left to remove.
-- Stuart Cheshire, Apple Computer, regarding Zero Configuration Networking

_______________________________________________
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