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

Method visit_func_def

mypy/strconv.py:144–160  ·  view source on GitHub ↗
(self, o: mypy.nodes.FuncDef)

Source from the content-addressed store, hash-verified

142 # Definitions
143
144 def visit_func_def(self, o: mypy.nodes.FuncDef) -> str:
145 a = self.func_helper(o)
146 a.insert(0, o.name)
147 arg_kinds = {arg.kind for arg in o.arguments}
148 if len(arg_kinds & {mypy.nodes.ARG_NAMED, mypy.nodes.ARG_NAMED_OPT}) > 0:
149 a.insert(1, f"MaxPos({o.max_pos})")
150 if o.is_coroutine:
151 a.insert(1, "Async")
152 if o.abstract_status in (mypy.nodes.IS_ABSTRACT, mypy.nodes.IMPLICITLY_ABSTRACT):
153 a.insert(-1, "Abstract")
154 if o.is_static:
155 a.insert(-1, "Static")
156 if o.is_class:
157 a.insert(-1, "Class")
158 if o.is_property:
159 a.insert(-1, "Property")
160 return self.dump(a, o)
161
162 def visit_overloaded_func_def(self, o: mypy.nodes.OverloadedFuncDef) -> str:
163 a: Any = o.items.copy()

Callers

nothing calls this directly

Calls 4

func_helperMethod · 0.95
dumpMethod · 0.95
lenFunction · 0.85
insertMethod · 0.80

Tested by

no test coverage detected