Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
@ogrisel Do you think we need to support "file-like" objects without a readinto() method?
Sorry, something went wrong.
There was a problem hiding this comment.
I don't have a strong opinion. Are there any such file objects in the standard library? The file-like objects that acts as wrappers for (de)compression algorithms such as GzipFile seem to support readinto.
Sorry, something went wrong.
There was a problem hiding this comment.
There doesn't seem to be any. I'll remove this snippet.
Sorry, something went wrong.
There was a problem hiding this comment.
Actually, the doc mentions that API contract for file is only to have read and readline, so I'm not sure it's ok to remove the fallback...
Sorry, something went wrong.
There was a problem hiding this comment.
Was the fallback ever added back? Looks like this came up as a real issue on https://bugs.python.org/issue39681
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for the ping. I'll reply on the issue.
Sorry, something went wrong.
Sorry, something went wrong.
|
Rebased. |
Sorry, something went wrong.
There was a problem hiding this comment.
Doc comments
Sorry, something went wrong.
| :class:`io.BytesIO` instance, or any other custom object that meets this | ||
| interface. | ||
| Arguments *file*, *protocol*, *fix_imports* and *buffer_callback* have | ||
| the same meaning as in :class:`Pickler`. |
There was a problem hiding this comment.
I like having the redundancy removed, as it reduces cognitive load.
Sorry, something went wrong.
|
Thanks Terry! I've applied the suggested changes now. |
Sorry, something went wrong.
There was a problem hiding this comment.
Here is my review, enjoy :-) I don't know well the pickle module, so I mostly checked the doc and basic stuff.
By the way, I really like the overall change and the PEP: it's a great enhancement, thanks!
Sorry, something went wrong.
|
|
||
| :class:`PickleBuffer` objects can only be serialized using pickle | ||
| protocol 5 or higher. They are eligible for | ||
| :ref:`out-of-band serialization <pickle-oob>`. |
There was a problem hiding this comment.
Maybe add a reference to your PEP?
Sorry, something went wrong.
There was a problem hiding this comment.
It is referenced at the end of the "Out-of-band Buffers" section. Since it's quite specialized, I'm not sure it's useful to mention it also here.
Sorry, something went wrong.
|
Thanks for the review @vstinner. I think I've addressed your comments now. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM. I didn't see any major issue, but I didn't review carefully the C code. Nice PEP, nice implementation, thanks ;-)
Sorry, something went wrong.
|
I'm gonna merge soon since no other review came and 3.8b1 is due next Friday. |
Sorry, something went wrong.
https://bugs.python.org/issue36785