Re: [Python-Dev] ABC issues

2008-06-07 Thread Georg Brandl
Guido van Rossum schrieb: On Mon, May 26, 2008 at 11:59 AM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: * The 2.6-backported Mapping ABC has the 3.0 dict API, that is, it uses keys() that returns a view etc. Curious to hear what Guido thinks about this one. A nice use of the Mapping ABC is t

Re: [Python-Dev] ABC issues

2008-05-27 Thread Guido van Rossum
On Tue, May 27, 2008 at 12:16 PM, Armin Ronacher <[EMAIL PROTECTED]> wrote: > Hi, > > Guido van Rossum python.org> writes: > >> There's no need to register as Sized -- the Sized ABC recognizes >> classes that define __len__ automatically. The Container class does >> the same looking for __contains

Re: [Python-Dev] ABC issues

2008-05-27 Thread Armin Ronacher
Hi, Guido van Rossum python.org> writes: > There's no need to register as Sized -- the Sized ABC recognizes > classes that define __len__ automatically. The Container class does > the same looking for __contains__. Since the deque class doesn't > implement __contains__, it is not considered a Co

Re: [Python-Dev] ABC issues

2008-05-27 Thread Raymond Hettinger
If you want to use the 3.0 mixins in 2.6, perhaps an alternate set of APIs could be imported from the future? E.g. from future_collections import Mapping. IIRC a similar mechanism was proposed for some built-in functions, even though I see no traces of an implementation yet. Any know what happen

Re: [Python-Dev] ABC issues

2008-05-27 Thread Guido van Rossum
On Tue, May 27, 2008 at 10:44 AM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: * The 2.6-backported Mapping ABC has the 3.0 dict API, that is, it uses keys() that returns a view etc. >>> >>> Curious to hear what Guido thinks about this one. >>> A nice use of the Mapping ABC is to be able

Re: [Python-Dev] ABC issues

2008-05-27 Thread Raymond Hettinger
* The 2.6-backported Mapping ABC has the 3.0 dict API, that is, it uses keys() that returns a view etc. Curious to hear what Guido thinks about this one. A nice use of the Mapping ABC is to be able to get 3.0 behaviors. I thought that was the whole point of all these backports. If the ABC get

Re: [Python-Dev] ABC issues

2008-05-27 Thread Guido van Rossum
On Mon, May 26, 2008 at 4:11 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: >>> Deque's do not support count(), insert() or __iadd__(). >>> They should not be registered. > >> If it doesn't implement the MutableSequence protocol it still is a Sized >> container. However currently it's not regist

Re: [Python-Dev] ABC issues

2008-05-27 Thread Guido van Rossum
On Mon, May 26, 2008 at 11:59 AM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: >> * The 2.6-backported Mapping ABC has the 3.0 dict API, >> that is, it uses keys() that returns a view etc. > > Curious to hear what Guido thinks about this one. > A nice use of the Mapping ABC is to be able to > get