Commit b7861ce
committed
Rework `_Extra` to keep the original `.strip()` behavior, to prevent
altering existing callers.
Add `.iter()` in place of `.strip()` to yield each subfield as tuples.
This has better semantic and is proved to be more performant than
subclassing `bytes` by benchmark. The method name change also allows
feature detection for the behavior changes. Also refactor
`ZipFile._decodeExtra` with this method.
1 parent 2ff724f commit b7861ce
3 files changed
Lines changed: 37 additions & 31 deletions
File tree
- Lib
- test/test_zipfile
- zipfile
- Misc/NEWS.d/next/Core_and_Builtins
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5840 | 5840 | | |
5841 | 5841 | | |
5842 | 5842 | | |
5843 | | - | |
| 5843 | + | |
5844 | 5844 | | |
5845 | 5845 | | |
5846 | 5846 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
197 | 225 | | |
198 | 226 | | |
199 | 227 | | |
| |||
390 | 418 | | |
391 | 419 | | |
392 | 420 | | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | 421 | | |
415 | 422 | | |
416 | 423 | | |
| |||
569 | 576 | | |
570 | 577 | | |
571 | 578 | | |
572 | | - | |
573 | 579 | | |
574 | | - | |
575 | | - | |
576 | | - | |
| 580 | + | |
| 581 | + | |
577 | 582 | | |
578 | 583 | | |
579 | 584 | | |
| |||
610 | 615 | | |
611 | 616 | | |
612 | 617 | | |
613 | | - | |
614 | | - | |
615 | 618 | | |
616 | 619 | | |
617 | 620 | | |
| |||
2650 | 2653 | | |
2651 | 2654 | | |
2652 | 2655 | | |
| 2656 | + | |
2653 | 2657 | | |
2654 | 2658 | | |
2655 | | - | |
2656 | | - | |
| 2659 | + | |
2657 | 2660 | | |
2658 | 2661 | | |
2659 | 2662 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments