Added get_container_type to get_zero_value
This commit is contained in:
parent
5ddfe34f0c
commit
7c4232455c
|
@ -118,6 +118,8 @@ class Container(object):
|
||||||
def get_zero_value(typ):
|
def get_zero_value(typ):
|
||||||
if typ == int:
|
if typ == int:
|
||||||
return 0
|
return 0
|
||||||
|
elif is_container_type(typ):
|
||||||
|
return typ(**{f: get_zero_value(t) for f, t in typ.get_fields()})
|
||||||
else:
|
else:
|
||||||
return typ.default()
|
return typ.default()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue