refactor: use is
instead of ==
(#560)
PLACEHOLDER is a specific instance of an object, the test here should be "is not" instead of "!=" I am experimenting with adding ndarray support, and the equality test here causes problems.
This commit is contained in:
parent
dbd31929d3
commit
e98c47861d
@ -749,7 +749,7 @@ class Message(ABC):
|
||||
group_current.setdefault(meta.group)
|
||||
|
||||
value = self.__raw_get(field_name)
|
||||
if value != PLACEHOLDER and not (meta.optional and value is None):
|
||||
if value is not PLACEHOLDER and not (meta.optional and value is None):
|
||||
# Found a non-sentinel value
|
||||
all_sentinel = False
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user