[Python-Dev] UserDict in 2.7
Raymond Hettinger
raymond.hettinger at gmail.com
Tue Jun 22 18:24:42 CEST 2010
On Jun 22, 2010, at 5:48 AM, Benjamin Peterson wrote:
> 2010/6/22 Raymond Hettinger <raymond.hettinger at gmail.com>:
>> There's an entry in whatsnew for 2.7 to the effect of "The UserDict class is
>> now a new-style class".
>> I had thought there was a conscious decision to not change any existing
>> classes from old-style to new-style. IIRC, Martin had championed this idea
>> and had rejected all of proposals to make existing classes inherit from
>> object.
>
> IIRC this was because UserDict tries to be a MutableMapping but abcs
> require new style classes.
ISTM, this change should be reverted to the way it was in 2.6.
The registration was already working fine:
Python 2.6.4 (r264:75821M, Oct 27 2009, 19:48:32)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
>>> import UserDict
>>> import collections
>>> collections.MutableMapping.register(UserDict.UserDict)
>>> issubclass(UserDict.UserDict, collections.MutableMapping)
True
We've didn't have any problems with this registration
nor did there seem to be an issue with UserDict not
implementing dictviews.
Please revert this change. UserDicts have a long history
and are used by a lot of code, so we need to avoid
unnecessary breakage.
Thank you,
Raymond
More information about the Python-Dev
mailing list