bpo-43224: Implement pickling of TypeVarTuples#32119
Merged
JelleZijlstra merged 12 commits intopython:mainfrom Apr 22, 2022
Merged
bpo-43224: Implement pickling of TypeVarTuples#32119JelleZijlstra merged 12 commits intopython:mainfrom
JelleZijlstra merged 12 commits intopython:mainfrom
Conversation
Member
Fidget-Spinner
left a comment
There was a problem hiding this comment.
correct in thinking we do need to test both assertEqual and assertIs for TypeVarTuples and unpacked TypeVarTuples?
IIRC, assertIs for pickle/unpickling isn't guaranteed, so we don't need to test for that.
Other than the tests, the code in typing.py LGTM.
Member
JelleZijlstra
left a comment
There was a problem hiding this comment.
Thanks, I think these tests are a bit repetitive.
This reverts commit de68232.
Member
|
Edit: Nevermind, I just read the bug report. |
Contributor
Author
|
Lol, my bad - I was cleaning up some old branches, and forgotten this hadn't yet been merged 😅 |
JelleZijlstra
approved these changes
Apr 21, 2022
Contributor
Author
|
Thanks, Jelle! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Guess who learned a whole bunch about how pickling works :)
Notes:
_BoundVarianceMixinalso contains a key ingredient for pickling of things that use it! I've refactored its__reduce__into a separate mixin for clarity.assertEquala reasonable way of testing this functionality? Am I correct in thinking we do need to test bothassertEqualandassertIsfor TypeVarTuples and unpacked TypeVarTuples?This PR doesn't include implementation of pickling support for unpacked native
tuple; I'll do that in a future PR. (And I guess we'll also need to add tests forcopy?)https://bugs.python.org/issue43224