<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, 3 Apr 2018 at 01:19 Serhiy Storchaka <<a href="mailto:storchaka@gmail.com">storchaka@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">03.04.18 01:57, Lukasz Langa пише:<br>
>> On Apr 2, 2018, at 2:13 PM, Antoine Pitrou <<a href="mailto:solipsis@pitrou.net" target="_blank">solipsis@pitrou.net</a>> wrote:<br>
>> On Mon, 2 Apr 2018 13:48:46 -0700<br>
>> Lukasz Langa <<a href="mailto:lukasz@langa.pl" target="_blank">lukasz@langa.pl</a>> wrote:<br>
>>> Pickle protocol version 4.0 was originally defined back in PEP 3154 and shipped as part of Python 3.4 back in 2011. Yet it's still not the default.<br>
>> Because we want pickles produced with the default to be readable by<br>
>> earlier Python 3 versions.<br>
>> (the same reason protocol 0 stayed the default throughout the Python 2<br>
>> lifetime)<br>
><br>
> Alright, so that means we can easily do this for Python 3.8, right? I mean, following Christian's logic, Python 3.3 is already dead, with its final release done in February 2016 and support dropped in September 2017 per PEP 398.<br>
><br>
> I think we need to get past thinking about "Python 2" vs. "Python 3". This frame of mind creates space for another mythical release of Python that will break all the compatibilities, something we promised not to do. A moving backward compatibility window that includes the last release still under security fixes seems like a good new framework for this.<br>
><br>
> What do you think?<br>
<br>
The only possible drawback of protocol 4 is that very short pickles can<br>
be longer than with protocol 3 due to additional 9 bytes for the FRAME<br>
header and less compact pickling of globals.<br>
<br>
This may be partially compensated by implementing additional<br>
optimizations and/or passing short pickles through pickletools.optimize().<br></blockquote><div><br></div><div>I think if you're that worried about specifics to that detail then you should be specifying the protocol level manually anyway. I view this like something in the peepholer: a freebie perf bump for those that aren't too worried about such things. :) <br></div></div></div>