Describe the bug
As per title, object.some_number < object.some_other_number raises TypeError
Example Schema and code
{
"title":"whatever",
"test": {"type": "number"}
}
>>> whatever.test < whatever.test
>>> whatever.test <= whatever.test
>>> whatever.test >= whatever.test
Expected behaviour
Returns a boolean value
Actual behaviour
Raises TypeError because int.__lt__ doesn't know how to deal with a Literal.
Suggested fix
In Literal.__lt__(self, other), use an isinstance(Literal, other) check, compare with other._value if it's another Literal
Describe the bug
As per title,
object.some_number < object.some_other_numberraisesTypeErrorExample Schema and code
Expected behaviour
Returns a boolean value
Actual behaviour
Raises
TypeErrorbecauseint.__lt__doesn't know how to deal with aLiteral.Suggested fix
In
Literal.__lt__(self, other), use anisinstance(Literal, other)check, compare withother._valueif it's anotherLiteral