Make helper.itemgetter_with_default function return a tuple to act more like operator.itemgetter
This commit is contained in:
parent
fa4b5eec63
commit
93f7628874
2 changed files with 4 additions and 4 deletions
|
@ -204,5 +204,5 @@ def boolcheck(var):
|
|||
else:
|
||||
return False
|
||||
|
||||
def itemgetter_with_default(defaults):
|
||||
return lambda obj: {k: obj.get(k, v) for k, v in defaults.items()}
|
||||
def itemgetter_with_default(**defaults):
|
||||
return lambda obj: tuple(obj.get(k, v) for k, v in defaults.items())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue