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

Function _verify_abstract_status

mypy/stubtest.py:1519–1525  ·  view source on GitHub ↗
(stub: nodes.FuncDef, runtime: Any)

Source from the content-addressed store, hash-verified

1517
1518
1519def _verify_abstract_status(stub: nodes.FuncDef, runtime: Any) -> Iterator[str]:
1520 stub_abstract = stub.abstract_status == nodes.IS_ABSTRACT
1521 runtime_abstract = getattr(runtime, "__isabstractmethod__", False)
1522 # The opposite can exist: some implementations omit `@abstractmethod` decorators
1523 if runtime_abstract and not stub_abstract:
1524 item_type = "property" if stub.is_property else "method"
1525 yield f"is inconsistent, runtime {item_type} is abstract but stub is not"
1526
1527
1528def _verify_final_method(

Callers 3

verify_funcitemFunction · 0.85
verify_overloadedfuncdefFunction · 0.85
verify_decoratorFunction · 0.85

Calls 1

getattrFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…