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

Function _get_bool_argument

mypy/plugins/common.py:66–73  ·  view source on GitHub ↗

Return the boolean value for an argument to a call or the default if it's not found.

(ctx: ClassDefContext, expr: CallExpr, name: str, default: bool)

Source from the content-addressed store, hash-verified

64
65
66def _get_bool_argument(ctx: ClassDefContext, expr: CallExpr, name: str, default: bool) -> bool:
67 """Return the boolean value for an argument to a call or the
68 default if it's not found.
69 """
70 attr_value = _get_argument(expr, name)
71 if attr_value:
72 return require_bool_literal_argument(ctx.api, attr_value, name, default)
73 return default
74
75
76def _get_argument(call: CallExpr, name: str) -> Expression | None:

Callers 2

Calls 2

_get_argumentFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…