[Python-Dev] ABC issues
Raymond Hettinger
python at rcn.com
Tue May 27 01:11:30 CEST 2008
From: "Armin Ronacher" <armin.ronacher at active-4.com>
> If the ABCs exists only for forward compatibility they will be mostly useless
> for every day usage.
The Mapping ABC is still useful as a mixin in code that will run
on both 2.6 and 3.0. It is the easiest way to start coding with views.
>> 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 registered as a container.
Seems useless to me. I don't think the intent of the ABC pep was
to mandate that every class that defines __len__ must be registered
as Sized.
> Another issue is that builtin types don't accept ABCs currently. For example
> set() | SomeSet() gives a TypeError, SomeSet() | set() however works.
Pandora's Box -- sure you want to open it?
Raymond
More information about the Python-Dev
mailing list