[Python-ideas] Add "default" kw argument to operator.itemgetter and operator.attrgetter

Raymond Hettinger raymond.hettinger at gmail.com
Thu May 3 01:28:33 EDT 2018



> On May 2, 2018, at 1:08 AM, Vincent Maillol <vincent.maillol at gmail.com> wrote:
> 
> Our PEP idea would be to purpose to add a global default value for
> itemgeet and attrgetter method.

My preference is to not grow that API further.  It is creep well beyond its intended uses.  At some point, we're really better off just using a lambda.


Raymond


More information about the Python-ideas mailing list