genomoncology / related

Nested Object Models in Python with dictionary, YAML, and JSON transformation support
MIT License
198 stars 15 forks source link

ChildField should create default values dynamically when type provided #33

Closed imaurer closed 5 years ago

imaurer commented 5 years ago

Passing in a value such as {}, set(), or [] as a default to a ChildField will cause that value to be shared across all instances of that model.

So, if a ChildField is provided a default that matches the class type and that class type is callable, the default value of new objects should be an invocation of that type.