[Python-ideas] Have dict().update() return its own reference.

Alexander Belopolsky alexander.belopolsky at gmail.com
Fri Apr 20 17:00:28 CEST 2012


On Fri, Apr 20, 2012 at 10:49 AM, Stefan Behnel <stefan_ml at behnel.de> wrote:
>> >>> a = {}
>> >>> b = {1:2}
>> >>> dict(a, **b)
>> {1: 2}
>
> That's no guaranteed behaviour, though. It doesn't work in PyPy, for example.

I seem to recall that CPython had a similar limitation in the past,
but it was removed at some point.  I will try to dig out the relevant
discussion, but I think the consensus was that ** should not attempt
validate the keys.



More information about the Python-ideas mailing list