[merge] Minor
This commit is contained in:
parent
201a681821
commit
0884507c0e
@ -83,12 +83,16 @@ def sumDicts(lst):
|
|||||||
return d
|
return d
|
||||||
|
|
||||||
def mergeObjects(lst):
|
def mergeObjects(lst):
|
||||||
lst = [item for item in lst if item is not None and item is not NotImplemented]
|
lst = [item for item in lst if item is not NotImplemented]
|
||||||
if not lst:
|
if not lst:
|
||||||
return None # Not all can be NotImplemented
|
return NotImplemented
|
||||||
|
lst = [item for item in lst if item is not None]
|
||||||
|
if not lst:
|
||||||
|
return None
|
||||||
|
|
||||||
clazz = lst[0].__class__
|
clazz = lst[0].__class__
|
||||||
assert all(type(item) == clazz for item in lst), lst
|
assert all(type(item) == clazz for item in lst), lst
|
||||||
|
|
||||||
logic = clazz.mergeMap
|
logic = clazz.mergeMap
|
||||||
returnTable = clazz()
|
returnTable = clazz()
|
||||||
returnDict = {}
|
returnDict = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user