[Python-ideas] dictionary constructor should not allow duplicate keys

Guido van Rossum guido at python.org
Wed May 4 11:32:58 EDT 2016

I honestly don't recall and I assume the docs are vague, but "comparing
expressions" was not a thing in ABC. I'm sure they compared the values.
(This is why I showed it with variables instead of constants.)

On Wed, May 4, 2016 at 8:29 AM, Michael Selik <michael.selik at gmail.com>

> On Wed, May 4, 2016 at 11:19 AM Guido van Rossum <guido at python.org> wrote:
>> - In ABC, this was considered, and the rule was that {k1: v1; k2: v2} was
>> allowed to have k1==k2 as long as v1==v2. Otherwise it was an error. (But
>> ABC did not have comprehensions.)
> Was that enforced by comparing the expressions or the resulting values?

--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160504/d3b9c005/attachment.html>

More information about the Python-ideas mailing list