tools-python
tools-python copied to clipboard
has_optional_field implementation may lead to unexpected results
has_optional_field(field) verifies whether the value of field is not None. But, some attributes are sometimes initialized as some default/empty object, like an empty list. In that example, has_optional_field(field) will always return True, even if the list is empty (when I think it should return False because there is actually no information).
I suggest: return bool(field)
Can I work on this issue ?