En Thu, 06 Aug 2009 05:26:22 -0300, Xavier Ho
escribió:
On Thu, Aug 6, 2009 at 1:19 PM, alex23 wrote:
Xavier Ho wrote:
> You should subclass collections.UserDict, and not the default dict
class.
Xavier, why do you think that is the correct approach?
I'll be honest first and say that I do
> Xavier Ho wrote:
> > You should subclass collections.UserDict, and not the default dict class.
> > Refer to the collections module.
>
> Xavier, why do you think that is the correct approach? The docs say
> "The need for this class has been largely supplanted by the ability to
> subclass directly
> Are you referring to Python 3.0? Python 2.6 does not have
> collections.UserDict
In Python2.6, it is in its own module.
>>> from UserDict import UserDict
Raymond
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 5, 7:39 am, Bruno Desthuilliers wrote:
> Sergey Simonenko a écrit :
>
> > Hi,
>
> > I subclass builtin 'dict' in my application and experience some problems
> > with it.
>
> > The whole issue is that I should redefine 'setdefault' and 'update'
> > methods after redefining '__setitem__' or/a
On Thu, Aug 6, 2009 at 1:19 PM, alex23 wrote:
> Xavier Ho wrote:
> > You should subclass collections.UserDict, and not the default dict class.
> > Refer to the collections module.
>
> Xavier, why do you think that is the correct approach?
I'll be honest first and say that I do not completely un
Xavier Ho wrote:
> You should subclass collections.UserDict, and not the default dict class.
> Refer to the collections module.
Xavier, why do you think that is the correct approach? The docs say
"The need for this class has been largely supplanted by the ability to
subclass directly from dict (a
On Thu, Aug 6, 2009 at 5:23 AM, Joshua Kugler wrote:
> Are you referring to Python 3.0? Python 2.6 does not have
> collections.UserDict
>
> j
>
Yes, I was sometimes it's hard to keep track what's not in 2.6 and in
3.1 for me, sorry. And thanks.
The ABC MutableMapping is still valid, though.
Xavier Ho wrote:
> On Thu, Aug 6, 2009 at 11:51 AM, Sergey Simonenko
> wrote:
>
>> I subclass builtin 'dict' in my application and experience some problems
>> with it.
>>
>
> You should subclass collections.UserDict, and not the default dict class.
> Refer to the collections module.
Are you ref
Sergey Simonenko a écrit :
Hi,
I subclass builtin 'dict' in my application and experience some problems
with it.
The whole issue is that I should redefine 'setdefault' and 'update'
methods after redefining '__setitem__' or/and '__delitem__',
otherwise 'update' and 'setdefault' ignore redefin
On Thu, Aug 6, 2009 at 11:51 AM, Sergey Simonenko wrote:
> I subclass builtin 'dict' in my application and experience some problems
> with it.
>
You should subclass collections.UserDict, and not the default dict class.
Refer to the collections module.
Also, the ABC MutableMapping might be of you
Hi,
I subclass builtin 'dict' in my application and experience some problems
with it.
The whole issue is that I should redefine 'setdefault' and 'update'
methods after redefining '__setitem__' or/and '__delitem__',
otherwise 'update' and 'setdefault' ignore redefined '__setitem__' and use
11 matches
Mail list logo