(self, o: AssignmentStmt)
| 197 | super().visit_type_application(o) |
| 198 | |
| 199 | def visit_assignment_stmt(self, o: AssignmentStmt) -> None: |
| 200 | self.line = o.line |
| 201 | if isinstance(o.rvalue, nodes.CallExpr) and isinstance( |
| 202 | o.rvalue.analyzed, nodes.TypeVarExpr |
| 203 | ): |
| 204 | # Type variable definition -- not a real assignment. |
| 205 | return |
| 206 | if o.type: |
| 207 | # If there is an explicit type, don't visit the l.h.s. as an expression |
| 208 | # to avoid double-counting and mishandling special forms. |
| 209 | self.type(o.type) |
| 210 | o.rvalue.accept(self) |
| 211 | return |
| 212 | elif self.inferred and not self.all_nodes: |
| 213 | # if self.all_nodes is set, lvalues will be visited later |
| 214 | for lvalue in o.lvalues: |
| 215 | if isinstance(lvalue, nodes.TupleExpr): |
| 216 | items = lvalue.items |
| 217 | else: |
| 218 | items = [lvalue] |
| 219 | for item in items: |
| 220 | if isinstance(item, RefExpr) and item.is_inferred_def: |
| 221 | if self.typemap is not None: |
| 222 | self.type(self.typemap.get(item)) |
| 223 | super().visit_assignment_stmt(o) |
| 224 | |
| 225 | def visit_expression_stmt(self, o: ExpressionStmt) -> None: |
| 226 | if isinstance(o.expr, (StrExpr, BytesExpr)): |
nothing calls this directly
no test coverage detected