[Python-ideas] creating dicts with duplicates on purpose [was Re: dictionary constructor should not allow duplicate keys]

Paul Moore p.f.moore at gmail.com
Wed May 4 12:42:33 EDT 2016


On 4 May 2016 at 17:06, Ethan Furman <ethan at stoneleaf.us> wrote:
>>>> colors
> {1: 'Red', 2: 'Light Blue', 3: 'Pink', 5: 'Dark Blue'}
>
> So my issue was not with your point, but with your explanation of the
> example of your point.

Ah, sorry. I hadn't checked and wasn't sure myself whether the first
pairing or the last took priority. I tried to be vague enough that it
didn't matter that I wasn't sure (my theoretical programmer who relied
on this behaviour clearly *would* be sure :-)) but I obviously failed.

The moral of the story is to check my examples before posting :-)
Paul


More information about the Python-ideas mailing list