Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(13011)

#29368: Optimize unpickling list-like objects

Can't Edit
Can't Publish+Mail
Start Review
Created:
2 years, 8 months ago by storchaka+cpython
Modified:
2 years, 8 months ago
Reviewers:
victor.stinner, pitrou
CC:
rhettinger, AntoinePitrou, haypo, Alexandre Vassalotti, devnull_psf.upfronthosting.co.za, storchaka
Visibility:
Public.

Patch Set 1 #

Total comments: 3

Patch Set 2 #

Total comments: 6

Patch Set 3 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Lib/pickle.py View 1 2 1 chunk +12 lines, -5 lines 0 comments Download
Misc/NEWS View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
Modules/_pickle.c View 1 2 3 chunks +41 lines, -19 lines 0 comments Download

Messages

Total messages: 4
victor.stinner_gmail.com
http://bugs.python.org/review/29368/diff/19830/Lib/pickle.py File Lib/pickle.py (right): http://bugs.python.org/review/29368/diff/19830/Lib/pickle.py#newcode1470 Lib/pickle.py:1470: pass I suggest to put the append code here. ...
2 years, 8 months ago #1
AntoinePitrou
https://bugs.python.org/review/29368/diff/19830/Modules/_pickle.c File Modules/_pickle.c (right): https://bugs.python.org/review/29368/diff/19830/Modules/_pickle.c#newcode5839 Modules/_pickle.c:5839: extend_func = _PyObject_GetAttrId(list, &PyId_extend); It would be nice to ...
2 years, 8 months ago #2
victor.stinner_gmail.com
http://bugs.python.org/review/29368/diff/19838/Lib/pickle.py File Lib/pickle.py (right): http://bugs.python.org/review/29368/diff/19838/Lib/pickle.py#newcode1474 Lib/pickle.py:1474: append = list_obj.append Please add also the comment here. ...
2 years, 8 months ago #3
storchaka
2 years, 8 months ago #4
https://bugs.python.org/review/29368/diff/19838/Lib/pickle.py
File Lib/pickle.py (right):

https://bugs.python.org/review/29368/diff/19838/Lib/pickle.py#newcode1474
Lib/pickle.py:1474: append = list_obj.append
On 2017/02/01 22:17:06, haypo wrote:
> Please add also the comment here.

Done.

https://bugs.python.org/review/29368/diff/19838/Misc/NEWS
File Misc/NEWS (right):

https://bugs.python.org/review/29368/diff/19838/Misc/NEWS#newcode223
Misc/NEWS:223: to 2 times.
On 2017/02/01 22:17:06, haypo wrote:
> Maybe give an example of list-like type: collections.deque?

Done.

https://bugs.python.org/review/29368/diff/19838/Modules/_pickle.c
File Modules/_pickle.c (right):

https://bugs.python.org/review/29368/diff/19838/Modules/_pickle.c#newcode5860
Modules/_pickle.c:5860: existing code when extend() is not implemented. */
On 2017/02/01 22:17:06, haypo wrote:
> I understood your comment, but I propose something simpler and more explicit:
> 
> Even if the PEP 307 requires extend() and append() methods, fall back on
> append() if the object has no extend() method  for backward compatibility with
> Python 3.5 and older.

Great. Your wording looks simpler to me. But I'll remove "with Python 3.5 and
older" because the compatibility is needed not with Python interpreter, but with
third-party classes worked in Python 3.5.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+