[Python-ideas] getitem(obj, key, default) [was: Default return values to int and float]

Jan Kaliszewski zuo at chopin.edu.pl
Tue Oct 4 01:24:03 CEST 2011


Nick Coghlan dixit (2011-10-03, 13:03):

> I'd sooner see a getitem/3 builtin
> that could be used to ignore any LookupError the way dict.get/3 allows
> KeyError to be ignored.

+1.

It's probably quite common case.

Regards.
*j




More information about the Python-ideas mailing list