`x.a = ...`, `for x.a in ...`, `del x.a`: not a read of `a`. `x.a += ...` is: it reads `a` (the getter runs) before it writes it.
(node)
| 4033 | |
| 4034 | |
| 4035 | def _python_attribute_is_store(node) -> bool: |
| 4036 | """`x.a = ...`, `for x.a in ...`, `del x.a`: not a read of `a`. `x.a += ...` |
| 4037 | is: it reads `a` (the getter runs) before it writes it.""" |
| 4038 | child, parent = node, node.parent |
| 4039 | while parent is not None and parent.type in ("pattern_list", "tuple_pattern", "list_pattern"): |
| 4040 | child, parent = parent, parent.parent |
| 4041 | if parent is None: |
| 4042 | return False |
| 4043 | if parent.type in ("assignment", "for_statement", "for_in_clause"): |
| 4044 | return _same_node(parent.child_by_field_name("left"), child) |
| 4045 | return parent.type == "delete_statement" |
| 4046 | |
| 4047 | |
| 4048 | def _python_property_reads( |
no test coverage detected