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
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
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
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
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
* 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
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
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