Re: [Python-Dev] UserDict in 2.7

2010-06-22 Thread Fred Drake
On Tue, Jun 22, 2010 at 7:17 PM, Raymond Hettinger wrote: > Benjamin fixed the UserDict  and ABC problem earlier today in r82155. > It is now the same as it was in Py2.6. Thanks, Benjamin! -Fred -- Fred L. Drake, Jr. "A storm broke loose in my mind." --Albert Einstein _

Re: [Python-Dev] UserDict in 2.7

2010-06-22 Thread Raymond Hettinger
On Jun 22, 2010, at 3:59 PM, Michael Foord wrote: > On 23/06/2010 00:03, Greg Ewing wrote: >> Benjamin Peterson wrote: >> >>> IIRC this was because UserDict tries to be a MutableMapping but abcs >>> require new style classes. >> >> Are there any use cases for UserList and UserDict in new >> cod

Re: [Python-Dev] UserDict in 2.7

2010-06-22 Thread Michael Foord
On 23/06/2010 00:03, Greg Ewing wrote: Benjamin Peterson wrote: IIRC this was because UserDict tries to be a MutableMapping but abcs require new style classes. Are there any use cases for UserList and UserDict in new code, now that list and dict can be subclassed? Inheriting from list or di

Re: [Python-Dev] UserDict in 2.7

2010-06-22 Thread Greg Ewing
Benjamin Peterson wrote: IIRC this was because UserDict tries to be a MutableMapping but abcs require new style classes. Are there any use cases for UserList and UserDict in new code, now that list and dict can be subclassed? If not, I don't think it would be a big problem if they were left o

Re: [Python-Dev] UserDict in 2.7

2010-06-22 Thread Raymond Hettinger
On Jun 22, 2010, at 10:08 AM, Benjamin Peterson wrote: > . There was a typo in > abc.py which prevented it from raising errors when non new-style class > objects were passed in. For 2.x, that was probably a good thing, a happy accident that made it possible to register existing mapping classes as

Re: [Python-Dev] UserDict in 2.7

2010-06-22 Thread Benjamin Peterson
2010/6/22 Raymond Hettinger : > > On Jun 22, 2010, at 5:48 AM, Benjamin Peterson wrote: > >> 2010/6/22 Raymond Hettinger : >>> 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

Re: [Python-Dev] UserDict in 2.7

2010-06-22 Thread Raymond Hettinger
On Jun 22, 2010, at 5:48 AM, Benjamin Peterson wrote: > 2010/6/22 Raymond Hettinger : >> 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

Re: [Python-Dev] UserDict in 2.7

2010-06-22 Thread Laurens Van Houtven
On Tue, Jun 22, 2010 at 2:40 PM, Fred Drake wrote: > On Tue, Jun 22, 2010 at 2:21 AM, Raymond Hettinger > wrote: >> I had thought there was a conscious decision to not change any existing >> classes from old-style to new-style. > > I thought so as well.  Changing any class from old-style to new-s

Re: [Python-Dev] UserDict in 2.7

2010-06-22 Thread Benjamin Peterson
2010/6/22 Raymond Hettinger : > 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 re

Re: [Python-Dev] UserDict in 2.7

2010-06-22 Thread Fred Drake
On Tue, Jun 22, 2010 at 2:21 AM, Raymond Hettinger wrote: > I had thought there was a conscious decision to not change any existing > classes from old-style to new-style. I thought so as well. Changing any class from old-style to new-style risks breaking applications in obscure & mysterious ways

[Python-Dev] UserDict in 2.7

2010-06-22 Thread Raymond Hettinger
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 exis