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

Method get_function_hook

mypy/plugin.py:625–639  ·  view source on GitHub ↗

Adjust the return type of a function call. This method is called after type checking a call. Plugin may adjust the return type inferred by mypy, and/or emit some error messages. Note, this hook is also called for class instantiation calls, so that in this example:

(self, fullname: str)

Source from the content-addressed store, hash-verified

623 return None
624
625 def get_function_hook(self, fullname: str) -> Callable[[FunctionContext], Type] | None:
626 """Adjust the return type of a function call.
627
628 This method is called after type checking a call. Plugin may adjust the return
629 type inferred by mypy, and/or emit some error messages. Note, this hook is also
630 called for class instantiation calls, so that in this example:
631
632 from lib import Class, do_stuff
633
634 do_stuff(42)
635 Class()
636
637 This method will be called with 'lib.do_stuff' and then with 'lib.Class'.
638 """
639 return None
640
641 def get_method_signature_hook(
642 self, fullname: str

Callers 3

apply_function_pluginMethod · 0.45
check_callable_callMethod · 0.45
get_function_hookMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected