-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When are Falsy values evaluated as None? #74
Comments
I fully agree with you, that an empty list should be ignored just a null value. |
Although I can see the argument for persisting an empty list when building an instance. You might want to append items in a subsequent step. So it would not always be desirable behavior. Maybe the class could preserve the list, but the serialization methods would "scrub" them or not based on a parameter? |
All are default behaviors from the |
Thanks! |
Description
I am creating a FHIR object using the models and a spreadsheet as a source
When there is repeating element and their is no data in the source, my code creates an empty list.
This empty list is preserved unlike when the element is None. I think when an element is evaluated to these Falsy types listed below I think it should behave the same ... namely the element value should be
None
. Note that in FHIR "when present, elements cannot be empty - they SHALL have a value attribute, child elements, or extensions".What I Did
As a convenience, I would like to see these falsy values be treated like None instead of persisting.
The text was updated successfully, but these errors were encountered: