(self, node)
| 28 | return False |
| 29 | |
| 30 | def visit_FunctionDef(self, node): |
| 31 | # delete_parameter adds a private sentinel value that leaks |
| 32 | # we do not want that sentinel value in the type hints but it breaks typing |
| 33 | # Does not apply to variadic arguments (args/kwargs) |
| 34 | for dec in node.decorator_list: |
| 35 | if "delete_parameter" in ast.unparse(dec): |
| 36 | deprecated_arg = dec.args[1].value |
| 37 | if ( |
| 38 | node.args.vararg is not None |
| 39 | and node.args.vararg.arg == deprecated_arg |
| 40 | ): |
| 41 | continue |
| 42 | if ( |
| 43 | node.args.kwarg is not None |
| 44 | and node.args.kwarg.arg == deprecated_arg |
| 45 | ): |
| 46 | continue |
| 47 | |
| 48 | parents = [] |
| 49 | if hasattr(node, "parent"): |
| 50 | parent = node.parent |
| 51 | while hasattr(parent, "parent") and not isinstance( |
| 52 | parent, ast.Module |
| 53 | ): |
| 54 | parents.insert(0, parent.name) |
| 55 | parent = parent.parent |
| 56 | parts = [*self.context, *parents, node.name] |
| 57 | if not self._is_already_allowed(parts): |
| 58 | self.output.write("\\.".join(parts) + "\n") |
| 59 | break |
| 60 | |
| 61 | def visit_ClassDef(self, node): |
| 62 | for dec in node.decorator_list: |
nothing calls this directly
no test coverage detected