Collect all of the (non-method) functions declared in a module.
(module: MypyFile)
| 196 | |
| 197 | |
| 198 | def get_module_func_defs(module: MypyFile) -> Iterable[FuncDef]: |
| 199 | """Collect all of the (non-method) functions declared in a module.""" |
| 200 | for node in module.names.values(): |
| 201 | # We need to filter out functions that are imported or |
| 202 | # aliases. The best way to do this seems to be by |
| 203 | # checking that the fullname matches. |
| 204 | if isinstance(node.node, (FuncDef, Decorator, OverloadedFuncDef)) and is_from_module( |
| 205 | node.node, module |
| 206 | ): |
| 207 | yield get_func_def(node.node) |
| 208 | |
| 209 | |
| 210 | def prepare_func_def( |
no test coverage detected
searching dependent graphs…