You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cPickle does not exist anymore (since 3.0), so it always fails with ImportError. If we want to be sure that both Python and C versions behave the same - we can surely do that with import_helper.import_fresh_module or we can drop this part and only keep pickle module direct usage (as other modules do). I prefer the second option, because of how other things are tested. But, in the end it is up to maintainers to decide :)
Not all pickle protocols are tested: we need to use pickle.HIGHEST_PROTOCOL instead of just three items
Here's how it is defined right now:
cpython/Lib/test/test_ast.py
Lines 640 to 655 in 837ba05
I see two major problems here:
cPickle
does not exist anymore (since 3.0), so it always fails withImportError
. If we want to be sure that both Python and C versions behave the same - we can surely do that withimport_helper.import_fresh_module
or we can drop this part and only keeppickle
module direct usage (as other modules do). I prefer the second option, because of how other things are tested. But, in the end it is up to maintainers to decide :)pickle
protocols are tested: we need to usepickle.HIGHEST_PROTOCOL
instead of just three itemsPR is incoming!
Linked PRs
test_pickling
case intest_ast.py
#100883The text was updated successfully, but these errors were encountered: