Inconsistency in dictionary behaviour: dict(dict) not calling __setitem__

Fredrik Lundh fredrik at pythonware.com
Tue Dec 12 18:03:08 EST 2006


Mitja Trampus wrote:

> I think what was unexpected for the OP is that dict.__init__ 
> does not use __setitem__ to create its internal structures. 

you can implement most methods on core objects in terms of other 
methods.  picking one by random, and then complaining that other
methods don't use the one you picked, strikes me as a rather
naive view of how object-oriented design works in practice.

</F>




More information about the Python-list mailing list