On 8/8/2013 5:32 PM, Joshua Landau wrote:
On 8 August 2013 21:03, Terry Reedy <tjre...@udel.edu> wrote:
If .pop were being added today, I would argue against including the index
parameter.

GASP! That's no fair!

1) When using pop you normally want to keep the mutability available,
so iter(mylist) is a no-go.
2) When using the index, it's often somewhere in the middle that
you're popping from

I have never done that and I do not believe I have ever seen that. It certainly is extremely rare in my experience. Removing an item *after* looking at it is something different.

for i in range(len(mylist), -1, -1):
  if pred(mylist[i]): del mylist[i]

--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to