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

Function verify_paramspecexpr

mypy/stubtest.py:1461–1474  ·  view source on GitHub ↗
(
    stub: nodes.ParamSpecExpr, runtime: MaybeMissing[Any], object_path: list[str]
)

Source from the content-addressed store, hash-verified

1459
1460@verify.register(nodes.ParamSpecExpr)
1461def verify_paramspecexpr(
1462 stub: nodes.ParamSpecExpr, runtime: MaybeMissing[Any], object_path: list[str]
1463) -> Iterator[Error]:
1464 if isinstance(runtime, Missing):
1465 yield Error(object_path, "is not present at runtime", stub, runtime)
1466 return
1467 maybe_paramspec_types = (
1468 getattr(typing, "ParamSpec", None),
1469 getattr(typing_extensions, "ParamSpec", None),
1470 )
1471 paramspec_types = tuple(t for t in maybe_paramspec_types if t is not None)
1472 if not paramspec_types or not isinstance(runtime, paramspec_types):
1473 yield Error(object_path, "is not a ParamSpec", stub, runtime)
1474 return
1475
1476
1477def _is_django_cached_property(runtime: Any) -> bool: # pragma: no cover

Callers

nothing calls this directly

Calls 4

isinstanceFunction · 0.85
ErrorClass · 0.85
getattrFunction · 0.85
tupleClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…