MCPcopy Index your code
hub / github.com/sphinx-doc/sphinx / get_self

Method get_self

sphinx/pycode/parser.py:328–334  ·  view source on GitHub ↗

Returns the name of the first argument if in a function.

(self)

Source from the content-addressed store, hash-verified

326 return False
327
328 def get_self(self) -> ast.arg | None:
329 """Returns the name of the first argument if in a function."""
330 if self.current_function and self.current_function.args.args:
331 return self.current_function.args.args[0]
332 if self.current_function and self.current_function.args.posonlyargs:
333 return self.current_function.args.posonlyargs[0]
334 return None
335
336 def get_line(self, lineno: int) -> str:
337 """Returns specified line."""

Callers 2

_handle_assignmentMethod · 0.95
visit_ExprMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected