Mike Orr wrote:
> On 8/16/07, Ian Bicking <[EMAIL PROTECTED]> wrote:
>> The mix-ins are still great though; DictMixin makes implementing
>> dict-like classes quite easy, much easier than subclassing dict itself.
>>   It is not often that I would recommend subclassing dict.
> 
> What's the problem with subclassing dict?  The only difficult part is
> remembering how to get data out of the superclass structure:  return
> self[key] .

With DictMixin you only have to implement __get/set/delitem__ and 
keys().  With dict they all work with the underlying implementation.  So 
doing something like making a case-insensitive dictionary is a lot 
harder when subclassing dict.



-- 
Ian Bicking : [EMAIL PROTECTED] : http://blog.ianbicking.org
             : Write code, do good : http://topp.openplans.org/careers

_______________________________________________
Paste-users mailing list
[email protected]
http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users

Reply via email to