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

kkumer kkumer at that-popular-search-engines-mail.com
Tue Jun 8 05:28:21 EDT 2010


(sorry for posting empty post by accident)

Peter Otten <__peter__ at web.de> wrote:
> it stops working -- probably a side-effect of some optimization.
> So if you change your hubDict's base class from dict to object you should 
> get the desired behaviour.

Yes, as already noted, this would require python >=1.6, and I am
reluctant to upgrade at this point.

What I ended up doing is to simply create a normal dictionary
and copy all items from my hubDict merged "dictionary" into it
just for the purpose of this one function call

auxdict = dict((it for it in hubDictinstance.items()))
f(**auxdict)

Since this happens only few times during runtime it's not a big deal.

Thanks to all for insights.

K.



More information about the Python-list mailing list