Re: [Python-ideas] dict(default=int)

2017-05-29 Thread Chris Angelico
On Tue, May 30, 2017 at 7:06 AM, Matt Gilson wrote: > On Mon, May 29, 2017 at 11:59 AM, Neil Girdhar > wrote: >> >> A long time ago, I proposed that the dict variants (sorteddict, >> defaultdict, weakkeydict, etc.) be made more discoverable by having them >> specified as keyword arguments and I g

Re: [Python-ideas] dict(default=int)

2017-05-29 Thread Ryan Gonzalez
Sometimes I feel that it would be neat of dict constructors (like proposed previously in the thread) could also be chained, e.g.: dict.ordered.default(int)(a=1, b=2) -- Ryan (ライアン) Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else http://refi64.com On May 29, 2017 2:06

[Python-ideas] SealedMock proposal for unittest.mock

2017-05-29 Thread Mario Corchero
Hello Everyone! First time writing to python-ideas. *Overview* Add a new mock class within the mock module , SealedMock (or RestrictedMock) that allows to restrict in a dynamic and recursive way the addition of attributes to it.

Re: [Python-ideas] dict(default=int)

2017-05-29 Thread Neil Girdhar
On Mon, May 29, 2017 at 5:06 PM Matt Gilson wrote: > On Mon, May 29, 2017 at 11:59 AM, Neil Girdhar > wrote: > >> A long time ago, I proposed that the dict variants (sorteddict, >> defaultdict, weakkeydict, etc.) be made more discoverable by having them >> specified as keyword arguments and I go

Re: [Python-ideas] dict(default=int)

2017-05-29 Thread Matt Gilson
On Mon, May 29, 2017 at 11:59 AM, Neil Girdhar wrote: > A long time ago, I proposed that the dict variants (sorteddict, > defaultdict, weakkeydict, etc.) be made more discoverable by having them > specified as keyword arguments and I got the same feedback that the poster > here is getting. Now,

Re: [Python-ideas] dict(default=int)

2017-05-29 Thread Neil Girdhar
A long time ago, I proposed that the dict variants (sorteddict, defaultdict, weakkeydict, etc.) be made more discoverable by having them specified as keyword arguments and I got the same feedback that the poster here is getting. Now, instead of moving these classes into dict, why not have a fa

Re: [Python-ideas] a memory-efficient variant of itertools.tee

2017-05-29 Thread Stephan Houben
Hi Franklin, Thanks. I should have tested with a larger sequence. I suppose delaying deletion by a bounded amount of objects is fine. I was concerned that a potentially unbounded amount of objects was kept. The "reference implementation" in the docs suggested that and my initial testing seemed t

Re: [Python-ideas] tweaking the file system path protocol

2017-05-29 Thread Wolfgang Maier
On 05/29/2017 09:55 AM, Serhiy Storchaka wrote: 29.05.17 00:33, Wolfgang Maier пише: The path protocol does *not* use __fspath__ as an indicator that an object's str-representation is intended to be used as a path. If you had wanted this, the PEP should have defined __fspath__ not as a method,

Re: [Python-ideas] tweaking the file system path protocol

2017-05-29 Thread Serhiy Storchaka
29.05.17 00:33, Wolfgang Maier пише: The path protocol does *not* use __fspath__ as an indicator that an object's str-representation is intended to be used as a path. If you had wanted this, the PEP should have defined __fspath__ not as a method, but as a flag and have the protocol check that