4 Oct
2011
4 Oct
'11
4:59 a.m.
Jan Kaliszewski wrote:
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.
Well, maybe. Some useful properties of dict.get() are that it avoids the overhead of catching an exception, and there is no danger of catching something coming from somewhere other than the indexing operation itself. You wouldn't get those from a generic version. -- Greg