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

Method visit_overloaded_func_def

mypy/stubgen.py:558–576  ·  view source on GitHub ↗

@property with setters and getters, @overload chain and some others.

(self, o: OverloadedFuncDef)

Source from the content-addressed store, hash-verified

556 self.check_undefined_names()
557
558 def visit_overloaded_func_def(self, o: OverloadedFuncDef) -> None:
559 """@property with setters and getters, @overload chain and some others."""
560 overload_chain = False
561 for item in o.items:
562 if not isinstance(item, Decorator):
563 continue
564 if self.is_private_name(item.func.name, item.func.fullname):
565 continue
566
567 self.process_decorator(item)
568 if not overload_chain:
569 self.visit_func_def(item.func)
570 if item.func.is_overload:
571 overload_chain = True
572 elif item.func.is_overload:
573 self.visit_func_def(item.func)
574 else:
575 # skip the overload implementation and clear the decorator we just processed
576 self.clear_decorators()
577
578 def get_default_function_sig(self, func_def: FuncDef, ctx: FunctionContext) -> FunctionSig:
579 args = self._get_func_args(func_def, ctx)

Callers

nothing calls this directly

Calls 5

process_decoratorMethod · 0.95
visit_func_defMethod · 0.95
clear_decoratorsMethod · 0.95
isinstanceFunction · 0.85
is_private_nameMethod · 0.80

Tested by

no test coverage detected