-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-88233: zipfile: refactor _strip_extra #102084
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
13f4fad
to
6ebff4a
Compare
…tras instead of a heavy-state loop.
6e57d1f
to
e6abc55
Compare
@serhiy-storchaka If you don't mind, would you take a look at this refactor - see if you have any concerns? |
|
* Refactor zipfile._strip_extra to use higher level abstractions for extras instead of a heavy-state loop. * Add blurb * Remove _strip_extra and use _Extra.strip directly. * Use memoryview to avoid unnecessary copies while splitting Extras.
* Refactor zipfile._strip_extra to use higher level abstractions for extras instead of a heavy-state loop. * Add blurb * Remove _strip_extra and use _Extra.strip directly. * Use memoryview to avoid unnecessary copies while splitting Extras.
While reviewing #96161, I too had difficulty fully understanding the complexities of
_strip_extra
function.This PR refactors that function to use a class with methods separating the concerns (parsing, splitting, filtering, modeling) and using a higher-level abstraction to model the concept.