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

Method visit_func

mypy/partially_defined.py:433–448  ·  view source on GitHub ↗
(self, o: FuncItem)

Source from the content-addressed store, hash-verified

431 super().visit_func_def(o)
432
433 def visit_func(self, o: FuncItem) -> None:
434 if o.is_dynamic() and not self.options.check_untyped_defs:
435 return
436
437 args = o.arguments or []
438 # Process initializers (defaults) outside the function scope.
439 for arg in args:
440 if arg.initializer is not None:
441 arg.initializer.accept(self)
442
443 self.tracker.enter_scope(ScopeType.Func)
444 for arg in args:
445 self.process_definition(arg.variable.name)
446 super().visit_var(arg.variable)
447 o.body.accept(self)
448 self.tracker.exit_scope()
449
450 def visit_generator_expr(self, o: GeneratorExpr) -> None:
451 self.tracker.enter_scope(ScopeType.Generator)

Callers

nothing calls this directly

Calls 6

process_definitionMethod · 0.95
exit_scopeMethod · 0.80
is_dynamicMethod · 0.45
acceptMethod · 0.45
enter_scopeMethod · 0.45
visit_varMethod · 0.45

Tested by

no test coverage detected