On 10 February 2015 at 00:29, Neil Girdhar <mistersh...@gmail.com> wrote: >> > function(**kw_arguments, **more_arguments) >> If the key "key1" is in both dictionaries, more_arguments wins, right? > > > There was some debate and it was decided that duplicate keyword arguments > would remain an error (for now at least). If you want to merge the > dictionaries with overriding, then you can still do: > > function(**{**kw_arguments, **more_arguments}) > > because **-unpacking in dicts overrides as you guessed.
Eww. Seriously, function(**{**kw_arguments, **more_arguments}) feels more like a Perl "executable line noise" construct than anything I'd ever want to see in Python. And taking something that doesn't work and saying you can make it work by wrapping **{...} round it just seems wrong. Paul _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com