Commit 77ebe2c
authored
gh-145300: Document bytearray.extend() behavior when mutating during iteration
Add a note to sequence.extend() documentation clarifying that bytearray
behaves differently from list and array.array when extending a sequence
with itself during iteration. bytearray captures the length at the start
and can at most double the original length, while list and array.array
pick up elements as they're added, potentially leading to unbounded growth.1 parent 149c465 commit 77ebe2c
1 file changed
+11
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1328 | 1328 | | |
1329 | 1329 | | |
1330 | 1330 | | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
1331 | 1342 | | |
1332 | 1343 | | |
1333 | 1344 | | |
| |||
0 commit comments