[Python-Dev] dict() enhancement idea?
Thu, 21 Nov 2002 18:00:51 -0800 (PST)
[Just van Rossum]
> I sometimes use an idiom like
> def dictfromkeywords(**kwargs):
> return kwargs
> d = dictfromkeywords(
> akey = 12,
> anotherkey = "foo",
So far everyone who has responded to this idea has admitted they have code
somewhere the operates like this.
> to conveniently build dicts with literal keys. I think I've seen Alex Martelli
> advertise it, too. Don't know how well known it is otherwise, but it is extremly
I think Alex has it in the Cookbook.