Commit cd6d90b
committed
Disallow assignment to '__class__' in TypeChecker.visit_assignment_stmt
Added a check inside TypeChecker.visit_assignment_stmt to disallow assignments to '__class__', as such assignments are unsafe and may lead to unpredictable behavior.
The new check raises an error using self.fail when '__class__' is assigned, matching the style used in other TypeChecker checks.
This change addresses issue #7724.1 parent 111a3c4 commit cd6d90b
1 file changed
+1
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8882 | 8882 | | |
8883 | 8883 | | |
8884 | 8884 | | |
8885 | | - | |
8886 | | - | |
8887 | | - | |
8888 | | - | |
8889 | | - | |
| 8885 | + | |
8890 | 8886 | | |
8891 | 8887 | | |
8892 | 8888 | | |
| |||
0 commit comments