Commit 0177c0d
authored
Improve our support for hasattr() (#20914)
Our support for `hasattr()` is quite fragile/limited. In particular, it
didn't work if there was an existing narrowing in the current frame. For
`--allow-redefinition-new` this was a critical hit, since it can do
`binder.put()` on initial assignment, thus making our `hasattr()`
support non-functional.
This (somewhat ad-hoc) fix seems to restore parity for `hasattr()`
support. Also it may even improve `hasattr()` support n regular mode in
some edge cases1 parent 0d20e52 commit 0177c0d
4 files changed
Lines changed: 61 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
396 | | - | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
397 | 404 | | |
398 | 405 | | |
399 | 406 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
632 | | - | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
633 | 636 | | |
634 | | - | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
635 | 649 | | |
636 | 650 | | |
637 | 651 | | |
| |||
1220 | 1234 | | |
1221 | 1235 | | |
1222 | 1236 | | |
1223 | | - | |
| 1237 | + | |
1224 | 1238 | | |
1225 | 1239 | | |
1226 | 1240 | | |
| 1241 | + | |
| 1242 | + | |
1227 | 1243 | | |
1228 | 1244 | | |
1229 | 1245 | | |
1230 | 1246 | | |
1231 | | - | |
1232 | | - | |
1233 | 1247 | | |
1234 | 1248 | | |
1235 | 1249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
117 | 150 | | |
118 | 151 | | |
119 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
0 commit comments