This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients EvKounis, Jim Fasarakis-Hilliard, ncoghlan, rhettinger, xiang.zhang
Date 2018-04-27.10:01:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1524823297.5.0.682650639539.issue29652@psf.upfronthosting.co.za>
In-reply-to
Content
The current discrepancy is odd when you compare it to the equivalent generator expression:

    {k:v for k, v in iterable}

    dict(((k, v) for k, v in iterable))

It would never have occurred to me to expect the evaluation order to match a fully unrolled loop with a nested "d[k] = v" assignment, because the dict constructor doesn't work that way - it accepts an iterable of 2-tuples.

PEP 274 also specifies the iterable-of-2-tuples interpretation (using a list comprehension as its baseline rather than a generator expression): https://www.python.org/dev/peps/pep-0274/#semantics
History
Date User Action Args
2018-04-27 10:01:37ncoghlansetrecipients: + ncoghlan, rhettinger, xiang.zhang, Jim Fasarakis-Hilliard, EvKounis
2018-04-27 10:01:37ncoghlansetmessageid: <1524823297.5.0.682650639539.issue29652@psf.upfronthosting.co.za>
2018-04-27 10:01:37ncoghlanlinkissue29652 messages
2018-04-27 10:01:37ncoghlancreate