[issue32979] dict get() function equivalent for lists.

2018-03-01 Thread Felix
Felix added the comment: Thanks for the link! Interesting read. I have to disagree with the statement that this is something that happens very rarely. Just have a look at the mess on stackoverflow alone (these are only the top results I got after a minute of googling): https://stackoverflow.

[issue32979] dict get() function equivalent for lists.

2018-03-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: Yes, this was discussed and rejected several years ago. Thank you for the suggestion. -- nosy: +rhettinger resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker

[issue32979] dict get() function equivalent for lists.

2018-03-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It was suggested a year ago. See the topic "get() method for list and tuples" on the Python-ideas mailing list. https://mail.python.org/pipermail/python-ideas/2017-February/044839.html -- nosy: +serhiy.storchaka

[issue32979] dict get() function equivalent for lists.

2018-03-01 Thread Felix
New submission from Felix : Hi there! I hope this wasn't suggested before. I couldn't find any issues related to it. The `get()` function on the dictionary object is such a convenient way for retrieving items from a dict that might not exists. I always wondered why the list object does not ha