(self, o: FuncDef, /)
| 258 | self.mapper = mapper |
| 259 | |
| 260 | def visit_func_def(self, o: FuncDef, /) -> None: |
| 261 | if self.func_depth > 0: |
| 262 | self.annotate( |
| 263 | o, |
| 264 | "A nested function object is allocated each time statement is executed. " |
| 265 | + "A module-level function would be faster.", |
| 266 | ) |
| 267 | self.func_depth += 1 |
| 268 | super().visit_func_def(o) |
| 269 | self.func_depth -= 1 |
| 270 | |
| 271 | def visit_for_stmt(self, o: ForStmt, /) -> None: |
| 272 | self.check_iteration([o.expr], "For loop") |