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

Function add_overloaded_method_hook

test-data/unit/plugins/add_overloaded_method.py:17–24  ·  view source on GitHub ↗
(ctx: ClassDefContext)

Source from the content-addressed store, hash-verified

15
16
17def add_overloaded_method_hook(ctx: ClassDefContext) -> None:
18 add_overloaded_method_to_class(ctx.api, ctx.cls, "method", _generate_method_specs(ctx))
19 add_overloaded_method_to_class(
20 ctx.api, ctx.cls, "clsmethod", _generate_method_specs(ctx), is_classmethod=True
21 )
22 add_overloaded_method_to_class(
23 ctx.api, ctx.cls, "stmethod", _generate_method_specs(ctx), is_staticmethod=True
24 )
25
26
27def _generate_method_specs(ctx: ClassDefContext) -> list[MethodSpec]:

Callers

nothing calls this directly

Calls 2

_generate_method_specsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…