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

Method _get_func_docstring

mypy/stubgen.py:692–698  ·  view source on GitHub ↗
(self, node: FuncDef)

Source from the content-addressed store, hash-verified

690 return None
691
692 def _get_func_docstring(self, node: FuncDef) -> str | None:
693 if not node.body.body:
694 return None
695 expr = node.body.body[0]
696 if isinstance(expr, ExpressionStmt) and isinstance(expr.expr, StrExpr):
697 return expr.expr.value
698 return None
699
700 def visit_func_def(self, o: FuncDef) -> None:
701 is_dataclass_generated = (

Callers

nothing calls this directly

Calls 1

isinstanceFunction · 0.85

Tested by

no test coverage detected