You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a result, if an enum has a nan in it, it will no longer validate a nan instance, since nan == nan returns False.
The previous behaviour used in, which calls the containers __contains__ method. For standard containers, that uses both is and == to check for comparison, which is why this worked before this commit.
One possible fix would be to check if one is two at the beginning of the equal method.
The text was updated successfully, but these errors were encountered:
Similar to #1222NaN doesn't exist in JSON, and therefore not in JSON Schema so it isn't really supported by this library and there's certainly no guarantees about how it behaves. That being said, I'm happy nonetheless to merge your PR, but only really because an is check might help in a tiny way for other comparison speedups. There again would be no promises about behavior of nan in particular.
As a result of the change in a9bf13c
equal
(which uses ==) is now used for all enum (https://github.com/python-jsonschema/jsonschema/blob/main/jsonschema/_keywords.py#L269) validations.As a result, if an enum has a
nan
in it, it will no longer validate anan
instance, sincenan == nan
returns False.The previous behaviour used
in
, which calls the containers__contains__
method. For standard containers, that uses bothis
and==
to check for comparison, which is why this worked before this commit.One possible fix would be to check if
one is two
at the beginning of theequal
method.The text was updated successfully, but these errors were encountered: