[Python-ideas] Allow multiple arguments to `list.remove` and flag for silent fail

Ram Rachum ram.rachum at gmail.com
Mon Aug 26 19:11:56 CEST 2013


Why do I have to do this: 

for thing in things:
    try:
        my_list.remove(thing)
    except ValueError:
        pass


When I could do this: 

my_list.remove(*things, silent_fail=True)


Aside from being much more concise, it could be more efficient too, 
couldn't it? 


Ram.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130826/78b281f2/attachment.html>


More information about the Python-ideas mailing list