bpo-43224: Implement pickling of TypeVarTuples#32119
Conversation
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.
Sorry, something went wrong.
JelleZijlstra
left a comment
There was a problem hiding this comment.
Thanks, I think these tests are a bit repetitive.
Sorry, something went wrong.
This reverts commit de68232.
Fidget-Spinner
left a comment
There was a problem hiding this comment.
LGTM. Thanks!
Sorry, something went wrong.
|
Edit: Nevermind, I just read the bug report. |
Sorry, something went wrong.
|
Lol, my bad - I was cleaning up some old branches, and forgotten this hadn't yet been merged 😅 |
Sorry, something went wrong.
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
Thanks, Jelle! |
Sorry, something went wrong.
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