[Python-ideas] dictionary unpacking
Aahz
aahz at pythoncraft.com
Mon Mar 31 16:43:09 CEST 2008
On Mon, Mar 31, 2008, Mathias Panzenb?ck wrote:
>
> Maybe dictionary unpacking would be a nice thing?
>
> >>> d = {'foo': 42, 'egg': 23}
> >>> {'foo': bar, 'egg': spam} = d
> >>> print bar, spam
> 42 23
>
> What do you think? Bad idea? Good idea?
Horrible idea. ;-)
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"It is easier to optimize correct code than to correct optimized code."
--Bill Harlan
More information about the Python-ideas
mailing list