[Python-Dev] chained assignment weirdity

Serhiy Storchaka storchaka at gmail.com
Wed Nov 7 08:49:43 CET 2012

On 06.11.12 21:00, Ned Batchelder wrote:
> If someone really needs to control whether the keys or values
> are evaluated first, they shouldn't use a dict literal.

Not only a dict literal.

 >>> {print('foo'): print('bar') for x in [1]}
{None: None}

More information about the Python-Dev mailing list