allow easy detection of empty view/get/place

This commit is contained in:
Martin Diehl 2021-04-10 09:33:45 +02:00
parent 07d573a56d
commit d304654972
1 changed files with 2 additions and 2 deletions

View File

@ -1266,7 +1266,7 @@ class Result:
if prune: r = util.dict_prune(r) if prune: r = util.dict_prune(r)
if flatten: r = util.dict_flatten(r) if flatten: r = util.dict_flatten(r)
return r return None if (type(r) == dict and r == {}) else r
def place(self,output='*',flatten=True,prune=True,constituents=None,fill_float=np.nan,fill_int=0): def place(self,output='*',flatten=True,prune=True,constituents=None,fill_float=np.nan,fill_int=0):
@ -1353,4 +1353,4 @@ class Result:
if prune: r = util.dict_prune(r) if prune: r = util.dict_prune(r)
if flatten: r = util.dict_flatten(r) if flatten: r = util.dict_flatten(r)
return r return None if (type(r) == dict and r == {}) else r