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
Provide a strict form of zip (PEP-618) requiring same length inputs #84816
Comments
PEP-618 https://www.python.org/dev/peps/pep-0618 discussions are still on going. This issue is being filed to track an implementation, assuming the PEP is accepted and one is decided upon. I'm filing it now, as I can at least use the issue for documentation enhancements of the existing zip() behavior. |
Ram, please fix the typo pointed out on github 59cf853#r40044022 |
I'll fix that typo. |
Tests test_zip_pickle_stability and test_zip_pickle_strict_stability look excessively strict. Why did we need them if there are other pickle tests? They prevent implementing optimizations like in bpo-36694. |
That's fair. How do other builtins validate their pickling implementation? Since the pickling goes through __reduce__/reduce_ex we could instead test that those methods return the expected results, that pickling roundtrips, and that unpickling those exact byte strings produces the expected value? |
For other types we do not have such strict tests. We just test that pickling roundtrips (it is already tested for zip() in other tests). There are few tests that unpickling some exact byte strings produces the expected value, but these tests are in pickletester.py, because they test the unpickling machinery. If unpickling of some type depends on some private constructor (like re._compile), that constructor can be tested separately. So I think that these tests can be removed. |
Sounds good, go for it. I assume @brandtbucher won't mind. |
Yep, fine by me. I can remove them later today (unless Serhiy beats me to it). |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: