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

Function _generate_method_specs

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

Source from the content-addressed store, hash-verified

25
26
27def _generate_method_specs(ctx: ClassDefContext) -> list[MethodSpec]:
28 return [
29 MethodSpec(
30 args=[Argument(Var("arg"), ctx.api.named_type("builtins.int"), None, ARG_POS)],
31 return_type=ctx.api.named_type("builtins.str"),
32 ),
33 MethodSpec(
34 args=[Argument(Var("arg"), ctx.api.named_type("builtins.str"), None, ARG_POS)],
35 return_type=ctx.api.named_type("builtins.int"),
36 ),
37 ]
38
39
40def plugin(version: str) -> type[OverloadedMethodPlugin]:

Callers 1

Calls 4

MethodSpecClass · 0.90
ArgumentClass · 0.90
VarClass · 0.90
named_typeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…