Re: [Python-Dev] PEP 574 (pickle 5) implementation and backport available

2018-05-25 Thread Nathaniel Smith
On Fri, May 25, 2018 at 3:35 PM, Neil Schemenauer wrote: > This discussion can easily lead into bikeshedding (e.g. relative > merits of different compression schemes). Since I'm not > volunteering to implement anything, I will stop responding at this > point. ;-) I think the bikeshedding -- or m

Re: [Python-Dev] Add __reversed__ methods for dict

2018-05-25 Thread Ramsey D'silva
I am also in agreement. On Fri, May 25, 2018, 13:49 Guido van Rossum wrote: > OK, +1 > > On Fri, May 25, 2018 at 10:26 AM, Raymond Hettinger < > raymond.hettin...@gmail.com> wrote: > >> >> >> > On May 25, 2018, at 9:32 AM, Antoine Pitrou >> wrote: >> > >> > It's worth nothing that OrderedDict a

Re: [Python-Dev] PEP 574 (pickle 5) implementation and backport available

2018-05-25 Thread Neil Schemenauer
On 2018-05-25, Antoine Pitrou wrote: > The question is what purpose does it serve for pickle to do it rather > than for the user to compress the pickle themselves. You're basically > saving one line of code. It's one line of code everywhere pickling or unpicking happens. And you probably need to

Re: [Python-Dev] PEP 574 (pickle 5) implementation and backport available

2018-05-25 Thread Antoine Pitrou
On Fri, 25 May 2018 14:50:57 -0600 Neil Schemenauer wrote: > On 2018-05-25, Antoine Pitrou wrote: > > Do you have something specific in mind? > > I think compressed by default is a good idea. My quick proposal: > > - Use fast compression like lz4 or zlib with Z_BEST_SPEED > > - Add a 'compre

Re: [Python-Dev] PEP 574 (pickle 5) implementation and backport available

2018-05-25 Thread Neil Schemenauer
On 2018-05-25, Antoine Pitrou wrote: > Do you have something specific in mind? I think compressed by default is a good idea. My quick proposal: - Use fast compression like lz4 or zlib with Z_BEST_SPEED - Add a 'compress' keyword argument with a default of None. For protocol 5, None means to

Re: [Python-Dev] PEP 574 (pickle 5) implementation and backport available

2018-05-25 Thread Ivan Pozdeev via Python-Dev
On 25.05.2018 20:36, Raymond Hettinger wrote: On May 24, 2018, at 10:57 AM, Antoine Pitrou wrote: While PEP 574 (pickle protocol 5 with out-of-band data) is still in draft status, I've made available an implementation in branch "pickle5" in my GitHub fork of CPython: https://github.com/pitrou

Re: [Python-Dev] PEP 574 (pickle 5) implementation and backport available

2018-05-25 Thread Antoine Pitrou
On Fri, 25 May 2018 10:36:08 -0700 Raymond Hettinger wrote: > > On May 24, 2018, at 10:57 AM, Antoine Pitrou wrote: > > > > While PEP 574 (pickle protocol 5 with out-of-band data) is still in > > draft status, I've made available an implementation in branch "pickle5" > > in my GitHub fork of CPy

Re: [Python-Dev] Add __reversed__ methods for dict

2018-05-25 Thread Guido van Rossum
OK, +1 On Fri, May 25, 2018 at 10:26 AM, Raymond Hettinger < raymond.hettin...@gmail.com> wrote: > > > > On May 25, 2018, at 9:32 AM, Antoine Pitrou wrote: > > > > It's worth nothing that OrderedDict already supports reversed(). > > The argument could go both ways: > > > > 1. dict is similar to

Re: [Python-Dev] PEP 574 (pickle 5) implementation and backport available

2018-05-25 Thread Raymond Hettinger
> On May 24, 2018, at 10:57 AM, Antoine Pitrou wrote: > > While PEP 574 (pickle protocol 5 with out-of-band data) is still in > draft status, I've made available an implementation in branch "pickle5" > in my GitHub fork of CPython: > https://github.com/pitrou/cpython/tree/pickle5 > > Also I've

Re: [Python-Dev] Add __reversed__ methods for dict

2018-05-25 Thread Raymond Hettinger
> On May 25, 2018, at 9:32 AM, Antoine Pitrou wrote: > > It's worth nothing that OrderedDict already supports reversed(). > The argument could go both ways: > > 1. dict is similar to OrderedDict nowadays, so it should support > reversed() too; > > 2. you can use OrderedDict to signal explic

Re: [Python-Dev] PEP 574 (pickle 5) implementation and backport available

2018-05-25 Thread Olivier Grisel
I tried this implementation to add no-copy pickling for large numpy arrays and seems to work as expected (for a simple contiguous array). I took some notes on the numpy tracker to advertise this PEP to the numpy developers: https://github.com/numpy/numpy/issues/11161 -- Olivier ​ ___

Re: [Python-Dev] Add __reversed__ methods for dict

2018-05-25 Thread Antoine Pitrou
It's worth nothing that OrderedDict already supports reversed(). The argument could go both ways: 1. dict is similar to OrderedDict nowadays, so it should support reversed() too; 2. you can use OrderedDict to signal explicitly that you care about ordering; no need to add anything to dict.

[Python-Dev] Summary of Python tracker Issues

2018-05-25 Thread Python tracker
ACTIVITY SUMMARY (2018-05-18 - 2018-05-25) Python tracker at https://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open6699 (+13) closed 38700 (+63) total 45399 (+76) Open issues wi

Re: [Python-Dev] Add __reversed__ methods for dict

2018-05-25 Thread Victor Stinner
INADA Naoki asked Rémi Lapeyre in https://bugs.python.org/issue33462 to start a discussion on python-dev. Victor 2018-05-25 17:48 GMT+02:00 Guido van Rossum : > (Also this probably belongs in python-ideas, unless there's already a > bugs.python.org issue for it -- but you didn't mention that so I

Re: [Python-Dev] Add __reversed__ methods for dict

2018-05-25 Thread Victor Stinner
It looks like an optimization, since you can already do something like reversed(list(d)). Do you have benchmark numbers to see the benefit of your change? Even if reversed(list(d)) is slow, I'm not sure that it's worth it to optimize it, since it's a rare usecase. Victor 2018-05-24 14:55 GMT+02:

Re: [Python-Dev] Add __reversed__ methods for dict

2018-05-25 Thread Guido van Rossum
(Also this probably belongs in python-ideas, unless there's already a bugs.python.org issue for it -- but you didn't mention that so I assume it's just an idea? How did you reach the line count estimates?) On Fri, May 25, 2018 at 8:46 AM, Guido van Rossum wrote: > Please go find some real world

Re: [Python-Dev] Add __reversed__ methods for dict

2018-05-25 Thread Guido van Rossum
Please go find some real world code that would benefit from this. Don't make up examples, just show some code in a repository (public if possible, but private is okay, as long as you can quote small amounts of code from it) where te existence of reverse iteration over a dict would have been helpful

[Python-Dev] Add __reversed__ methods for dict

2018-05-25 Thread Rémi Lapeyre
  Hi, since dict keys are sorted by their insertion order since Python 3.6 and that it’s part of Python specs since 3.7 a proposal has been made in bpo-33462 to  add the __reversed__ method to dict and dict views. Concerns have been raised in the comments that this feature may add too much  bloat

Re: [Python-Dev] "make test" routinely fails to terminate

2018-05-25 Thread Skip Montanaro
> me> On the 3.7 branch, "make test" routinely fails to terminate. > Antoine> Can you try to rebuild Python? Use "make distclean" if that helps. > Thanks, Antoine. That solved the termination problem. I still have problems > with test_asyncio failing, but I can live with that for now. Final foll