59 time: Optional[int] = Body(default=None),
60):
61 run = Run[id]
62 optimal = not time is None63
64 solver = select(s for s in Solver if s.name == solver)[:][0]
65 if not solver:
Tests for object identity should use the form x is not None
rather than not x is None
. The former example is more readable.
value = get_result()
if not value is None:
print(value)
value = get_result()
if value is not None:
print(value)