Find all the types of arguments that each arg is passed to. For example, given def foo(x: int) -> None: ... def bar(x: str) -> None: ... def test(x, y): foo(x) bar(y) this will return [[int], [str]].
(typemap: dict[Expression, Type], func: FuncDef)
| 195 | |
| 196 | |
| 197 | def get_arg_uses(typemap: dict[Expression, Type], func: FuncDef) -> list[list[Type]]: |
| 198 | """Find all the types of arguments that each arg is passed to. |
| 199 | |
| 200 | For example, given |
| 201 | def foo(x: int) -> None: ... |
| 202 | def bar(x: str) -> None: ... |
| 203 | def test(x, y): |
| 204 | foo(x) |
| 205 | bar(y) |
| 206 | |
| 207 | this will return [[int], [str]]. |
| 208 | """ |
| 209 | finder = ArgUseFinder(func, typemap) |
| 210 | func.body.accept(finder) |
| 211 | return [finder.arg_types[arg.variable] for arg in func.arguments] |
| 212 | |
| 213 | |
| 214 | class SuggestionFailure(Exception): |
no test coverage detected
searching dependent graphs…