On 05-05-18 09:33, Peter Otten wrote:
> I think you have established that there is no straight-forward way to write 
> this as a lambda. But is adding a default to itemgetter the right 
> conclusion?
>
> If there were an exception-catching decorator you could write
>
> f = catch(IndexError, "spam")(itemgetter(2))

I think your catch function would be a usefull addition, but I don't see
it solving this problem once we use itemgetter te get multiple entries.

-- 
Antoon.

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to