Which objects are expanded by double-star ** operator?

kkumer kkumer at this-popular-search-engines-mail.com
Tue Jun 8 05:44:53 EDT 2010


Bryan <bryanjugglercryptographer at yahoo.com> wrote:
> I get the same bug-like behavior in 3.1. I think Peter is right that
> it's probably a side-effect of an optimization. kkumer seems to have
> completely over-ridden the methods of dict, but if we insert into his
> hubDict with the parent class's method:
> 
>  dict.__setitem__(dh, 'c', 3)
> 
> Then the **dh argument passes the keyword arg c=3.

Yes. But problem is that this setting of item
should also affect one of the two original parent dicts,
while  your proposal affects only hubDict instance.
(hubDict is never used to create new items, just to change
values of existing ones, which belong to one of
two parents). 

K.



More information about the Python-list mailing list