Re: [Python-Dev] PEP 448 review

2015-03-17 Thread Brett Cannon
On Mon, Mar 16, 2015 at 7:11 PM Neil Girdhar wrote: > Hi everyone, > > I was wondering what is left with the PEP 448 ( > http://bugs.python.org/issue2292) code review? Big thanks to Benjamin, > Ethan, and Serhiy for reviewing some (all?) of the code. What is the next > step of this process? >

[Python-Dev] Possible wrong behavior of the dict?

2015-03-17 Thread Zaur Shibzukhov
Hello! In order to explain, let define subclass of dict: class Pair: def __init__(self, key, val): self.key = key self.val = val class MyDict(dict): # def __init__(self, *args, **kwds): if len(args) > 1: raise TypeError('Expected at most 1 argument

Re: [Python-Dev] Possible wrong behavior of the dict?

2015-03-17 Thread Brett Cannon
On Tue, Mar 17, 2015 at 3:05 PM Zaur Shibzukhov wrote: > Hello! > > In order to explain, let define subclass of dict: > > class Pair: > def __init__(self, key, val): > self.key = key > self.val = val > > class MyDict(dict): > # > def __init__(self, *args, **kwds): >

Re: [Python-Dev] Possible wrong behavior of the dict?

2015-03-17 Thread Zaur Shibzukhov
Yes... But I expected that dict constructor will use `__getitem__` or `items` method of MyDict instance in order to retrieve items of the MyDict instance during construction of the dict instance... Instead it interpreted MyDict instance as the dict instance during construction of new dict.This ex

Re: [Python-Dev] Possible wrong behavior of the dict?

2015-03-17 Thread Brett Cannon
On Tue, Mar 17, 2015 at 3:29 PM Zaur Shibzukhov wrote: > Yes... But I expected that dict constructor will use `__getitem__` or > `items` method of MyDict instance in order to retrieve items of the MyDict > instance during construction of the dict instance... Instead it interpreted > MyDict inst

Re: [Python-Dev] Possible wrong behavior of the dict?

2015-03-17 Thread Zaur Shibzukhov
So in such cases it should not subclassed `dict`, but `collections.MutableMapping`, for example? --- *Zaur Shibzukhov* 2015-03-17 22:38 GMT+03:00 Brett Cannon : > > > On Tue, Mar 17, 2015 at 3:29 PM Zaur Shibzukhov wrote: > >> Yes... But I expected that dict constructor will use `__getitem__`

Re: [Python-Dev] Possible wrong behavior of the dict?

2015-03-17 Thread Brett Cannon
On Tue, Mar 17, 2015 at 3:46 PM Zaur Shibzukhov wrote: > So in such cases it should not subclassed `dict`, but > `collections.MutableMapping`, for example? > Yes (see the comment at https://hg.python.org/cpython/file/22a0c925a7c2/Objects/dictobject.c#l2003 ). -Brett > > --- > *Zaur Shibzukhov

Re: [Python-Dev] Possible wrong behavior of the dict?

2015-03-17 Thread Zaur Shibzukhov
Thanks. --- *Zaur Shibzukhov* 2015-03-17 22:48 GMT+03:00 Brett Cannon : > > > On Tue, Mar 17, 2015 at 3:46 PM Zaur Shibzukhov wrote: > >> So in such cases it should not subclassed `dict`, but >> `collections.MutableMapping`, for example? >> > > Yes (see the comment at > https://hg.python.org/c

Re: [Python-Dev] Possible wrong behavior of the dict?

2015-03-17 Thread Florian Bruhin
* Zaur Shibzukhov [2015-03-17 22:29:07 +0300]: > Yes... But I expected that dict constructor will use `__getitem__` or > `items` method of MyDict instance in order to retrieve items of the MyDict > instance during construction of the dict instance... Instead it interpreted > MyDict instance as t

Re: [Python-Dev] PEP 489: Redesigning extension module loading

2015-03-17 Thread Mark Lawrence
On 16/03/2015 12:38, Petr Viktorin wrote: Hello, Can you use anything from the meta issue http://bugs.python.org/issue15787 for PEP 3121 and PEP 384 or will the work that you are doing render everything done previously redundant? -- My fellow Pythonistas, ask not what our language can do fo