Replies: 1 comment 1 reply
-
I think we could go back to the default empty list with the ability to override using ifabsent - I’m also curious if there is anyone with a strong opinion leaning towards the memory saving/efficiency of defaulting to None. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
LinkML formally doesn't distinguish between a null value and empty list for multivalued slots (see #1975 for discussion on this).
However, things are still left open for object model generators, in particular whether a default empty list should be set.
For dataclasses, the decision was made to have a default empty list. This means that code such as
will work without defensive coding.
Ideally we would like code in one language or one framework to operate in the same way. At the same time, it's good to respect language-specific idioms, and framework specific idioms.
Although there is no plan to change the underlying semantics where null and empty lists are equivalent for validation, we could easily introduce implementation hints into the spec, OR we could extend the
ifabsent
vocabulary to allow for specifying empty list vs null defaults.We would like some feedback on the desired behavior here before rolling out object model generators in a broader range of languages.
Beta Was this translation helpful? Give feedback.
All reactions