On 25Jan2010 12:34, Steve Howell <showel...@yahoo.com> wrote: | From: Raymond Hettinger <raymond.hettin...@gmail.com> | > 1) To many things in the Python world rely on | > the current implementation of lists. It's not | > worth breaking third-party extensions, tools like psyco, | > work on unladen swallow, and other implementations of Python | > such as PyPy and Jython. | | I don't understand how changing the implementation of CPython would | impact PyPy and Jython, unless you are just referring to the fact that | CPython is treated as a reference implementation, so its simplicity is | a virtue for other ports. Am I missing something else?
I can think of something: lists traditionally have O(n) pop(0) performance because they're normally quite simple layers on top of an array. (And likewise for pop(1), which your approach won't help; I know you could measure the list and decide pop(1) is a small copy of the left of the list along with a move of the base offset, but that degrades as you move from 0 and 1 to larger indices). Supposing pop(0) becomes cheap in CPython and this becomes well known (or worse, documented:-) Someone depending on this now has code that is fundamentally inefficient on other Pythons. I know this is a slightly thin objection, since your change can probably be taken to the other implementations. -- Cameron Simpson <c...@zip.com.au> DoD#743 http://www.cskk.ezoshosting.com/cs/ But pessimism IS realism! - D.L.Bahr _______________________________________________ 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