On Mon, Jan 25, 2010 at 23:57, Terry Reedy <tjre...@udel.edu> wrote: > On 1/25/2010 9:32 PM, Nick Coghlan wrote: > >> However, as Cameron pointed out, the O() value for an operation is an >> important characteristic of containers, and having people get used to an >> O(1) list.pop(0) in CPython could create problems not only for other >> current Python implementations but also for future versions of CPython >> itself. > > The idea that CPython should not be improved because it would spoil > programmers strikes me as a thin, even desparate objection. One could say > that same thing about the recent optimization of string += string so that > repeated concats are O(n) instead of O(n*n). What a trap if people move code > to other implementations (or older Python) without that new feature.
This is a much better optimization than the string appending optimization, as it is both portable and robust. I find it shocking to change a semantic I've come to see as a core part of the language, but I can't come up with a rational reason to oppose it. The approach is sane and the performance impact is (presumably) negligible. -- Adam Olsen, aka Rhamphoryncus _______________________________________________ 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