MCPcopy Index your code
hub / github.com/python/mypy / fixed_comparison

Function fixed_comparison

mypy/reachability.py:268–282  ·  view source on GitHub ↗
(left: Targ, op: str, right: Targ)

Source from the content-addressed store, hash-verified

266
267
268def fixed_comparison(left: Targ, op: str, right: Targ) -> int:
269 rmap = {False: ALWAYS_FALSE, True: ALWAYS_TRUE}
270 if op == "==":
271 return rmap[left == right]
272 if op == "!=":
273 return rmap[left != right]
274 if op == "<=":
275 return rmap[left <= right]
276 if op == ">=":
277 return rmap[left >= right]
278 if op == "<":
279 return rmap[left < right]
280 if op == ">":
281 return rmap[left > right]
282 return TRUTH_VALUE_UNKNOWN
283
284
285def contains_int_or_tuple_of_ints(expr: Expression) -> None | int | tuple[int, ...]:

Callers 2

consider_sys_platformFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…