-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
bpo-43224: Implement pickling of TypeVarTuples #32119
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I think these tests are a bit repetitive.
This reverts commit de68232.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
Edit: Nevermind, I just read the bug report. |
Lol, my bad - I was cleaning up some old branches, and forgotten this hadn't yet been merged 😅 |
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Thanks, Jelle! |
Guess who learned a whole bunch about how pickling works :)
Notes:
_BoundVarianceMixin
also contains a key ingredient for pickling of things that use it! I've refactored its__reduce__
into a separate mixin for clarity.assertEqual
a reasonable way of testing this functionality? Am I correct in thinking we do need to test bothassertEqual
andassertIs
for 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