[Python-Dev] ABC issues

Georg Brandl g.brandl at gmx.net
Sat Jun 7 20:16:16 CEST 2008


Guido van Rossum schrieb:
> On Mon, May 26, 2008 at 11:59 AM, Raymond Hettinger <python at rcn.com> 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 3.0 behaviors.  I thought that was the whole
>> point of all these backports.  If the ABC gets altered,
>> then it just makes the 2-to-3 conversion harder.
> 
> It's wrong if the ABC doesn't describe the behavior of actual
> implementations; that is its primary purpose, the mixin class is a
> nice side benefit.
> 
> We could make the incompatible mixin classes available separately
> though, if you think they're useful.
> 
>>> * The 2.6 UserDict is not registered as a mapping.
>>
>> Since the API's are not currently the same, it makes
>> sense that UserDict is not registered.
>> If the Mapping ABC does get changed, only IterableUserDict
>> should get registered.  A regular UserDict does not comply.
> 
> Fair enough. I recomment to fix the Mapping ABC and register IterableUserDict.

As a followup:
- The Mapping fix is in http://bugs.python.org/issue3057.
- Registering IterableUserDict is now in SVN.

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-Dev mailing list