FIX reduce method of unbound cython method#2969
Conversation
90f088e to
f26c01f
Compare
|
OK @scoder I think this PR is ready for review :) |
|
Note that the test is skipped for early Python versions because for Python versions |
|
Hmmm … I guess crossing the Py2/3 boundary with pickles isn't (well) supported anyway, so it's probably ok to make this incompatible. Does this also impact bound methods? Is there a test for those already? |
|
Bound methods are |
| @@ -300,5 +300,5 @@ if sys.version_info[:2] >= (3, 5): | |||
| True | |||
| >>> bound_method = pickle.loads(pickle.dumps(MyClass().my_method)) | |||
There was a problem hiding this comment.
And now that the method takes an argument, you could even call bound_method(42) here and see if it does the right thing.
There was a problem hiding this comment.
Yes. I encountered an obscure failure in the CI that I cannot reproduce locally after 1e2c7ee, so I am enriching the tests very incrementally to figure out what could have cause the failure. As soon as this turns green I'll add an assertion on the method's result.
There was a problem hiding this comment.
It's looking good now, so I'll add the assertion.
|
Thanks! |
|
Would it be possible to backport this to 0.29? Happy to submit a PR if that would help :) |
|
Seems reasonable. I've picked it over. |
|
Great thank you Stefan! 😄 |
Closes #2972
This was spotted thanks to cloudpipe/cloudpickle#259