[Python-ideas] Proposal how to remove all occurrences of a value from a Python list
Sven R. Kunze
srkunze at mail.de
Mon Oct 5 08:28:49 CEST 2015
On 04.10.2015 01:32, Andrew Barnert via Python-ideas wrote:
> And now, everywhere you use it looks like this:
>
> remove_all(arr, 1)
>
> And it's hard to imagine anything more readable.
arr.remove_all(1)
> And, even if remove_all isn't the kind of function an experienced developer would write, learning how to factor out the tricky bits into documentable and testable functions is one of the most useful skills for any developer in any language.#
True.
Btw. the same is true for Python core devs. This said, I would
appreciate the method 'remove_all' provided by the stdlib. ;-)
Best,
Sven
More information about the Python-ideas
mailing list