MCPcopy
hub / github.com/sphinx-doc/sphinx / is_overload

Method is_overload

sphinx/pycode/parser.py:315–326  ·  view source on GitHub ↗
(self, decorators: list[ast.expr])

Source from the content-addressed store, hash-verified

313 return False
314
315 def is_overload(self, decorators: list[ast.expr]) -> bool:
316 overload = {f'{modname}.overload' for modname in self.typing_mods}
317 overload |= self.typing_overload_names
318
319 for decorator in decorators:
320 try:
321 if ast_unparse(decorator) in overload:
322 return True
323 except NotImplementedError:
324 pass
325
326 return False
327
328 def get_self(self) -> ast.arg | None:
329 """Returns the name of the first argument if in a function."""

Callers 1

visit_FunctionDefMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected