concrete.util.unnone module

concrete.util.unnone.dun(d)

If l is None return an empty dict, else return l. Simplifies iteration over dict fields that might be unset.

Parameters:d (dict) – input dict (or None)
Return
d, or an empty dict if d is None
concrete.util.unnone.lun(lst)

If lst is None return an empty list, else return lst. Simplifies iteration over list fields that might be unset.

Parameters:lst (list) – input list (or None)
Return
lst, or an empty list if lst is None
concrete.util.unnone.sun(s)

If l is None return an empty set, else return l. Simplifies iteration over set fields that might be unset.

Parameters:s (set) – input set (or None)
Return
s, or an empty set if s is None