sorin sorin.sbar...@gmail.com added the comment:
+1 for adding it because it will make the code easier to read/understand.
Bad performance could be documented and it's related about internal
representation.
--
nosy: +sorin
___
Python tracker
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Sorry, this needs to stay closed.
It has no chance.
--
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9080
New submission from Andy Buckley a...@insectnation.org:
I know that Python lists aren't designed for efficient prepending, but
sometimes when working with small lists it's exactly what needs to be done
(search path lists being a common example). For a programmer aware of the
performance issue
Jean-Paul Calderone exar...@twistedmatrix.com added the comment:
Thanks for bringing this up.
I think you have more work to do to successfully make the case that L.insert(0,
x) is difficult enough to merit the addition of a new list method. There are
already at least two in-place
Andy Buckley a...@insectnation.org added the comment:
Maybe I just value method symmetry/equivalence higher than the designers when
it comes to interface expectations. I've seen several I expected there to be a
prepend() method like append() on lists, but there isn't -- what do I do?
emails
Ezio Melotti ezio.melo...@gmail.com added the comment:
If we add a .prepend() method, people will see it and start using it. Since now
there's no 'prepend' method people ask why, and the answer they usually get is
because it not a good idea to add elements on lists (but if you really have to
Mark Dickinson dicki...@gmail.com added the comment:
Andy, the bug-tracker isn't really the best place for this sort of discussion;
if you want to take this further I'd suggest mailing the python-ideas mailing
list (bigger audience).
FWIW, the bar for adding new methods to builtins should be
Jean-Paul Calderone exar...@twistedmatrix.com added the comment:
The argument that there are already two ways to do it, so why add a third?,
is not bad, but if applied to appending, it would ban the append() method...
except that it's already there.
Not quite. First let's consider the
Georg Brandl ge...@python.org added the comment:
[insert the usual reference to collections.deque here]
--
nosy: +georg.brandl
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9080
___
Ezio Melotti ezio.melo...@gmail.com added the comment:
Here:
http://docs.python.org/py3k/tutorial/datastructures.html#using-lists-as-queues
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9080
Andy Buckley a...@insectnation.org added the comment:
Still not convinced with the reasoning, I'm afraid, but I certainly agree that
modifications to built-ins are not to be made lightly. Using deques, which are
far less familiar, is not a particularly natural thing to do for a search path,
11 matches
Mail list logo