Make helper.itemgetter_with_default function return a tuple to act more like operator.itemgetter

This commit is contained in:
JonnyWong16 2019-10-07 13:46:38 -07:00
parent fa4b5eec63
commit 93f7628874
2 changed files with 4 additions and 4 deletions

View file

@ -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())