MCPcopy
hub / github.com/python/mypy / parse_bool

Function parse_bool

mypy/semanal_shared.py:489–495  ·  view source on GitHub ↗
(expr: Expression)

Source from the content-addressed store, hash-verified

487
488
489def parse_bool(expr: Expression) -> bool | None:
490 if isinstance(expr, NameExpr):
491 if expr.fullname == "builtins.True":
492 return True
493 if expr.fullname == "builtins.False":
494 return False
495 return None

Callers 3

parse_boolMethod · 0.90

Calls 1

isinstanceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…