"Almad" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hello,
>
> I discovered this behaviour in dictionary which I find confusing
...
> However, when constructing dictionary with dictionary in constructor
> like d = RegisterMap({'k':'v'}), __setitem__ is not called,

d.__setitem__(k,v) is the internal translation of d[k] = v (when such is 
explicitly written in this code).  d.__init__(otherdict) need not go thru 
that interface if a more direct means is available.

>so workaround is needed:

Your 'workaround' seems to be the proper solution.

> Am I doing something wrong

Denigrating a solution because it does not meet your expectation.

Your are not the first to do this ;-).

tjr




-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to