[Python-Dev] Any grammar experts?

Ethan Furman ethan at stoneleaf.us
Mon Jan 26 19:55:58 CET 2015


On 01/26/2015 10:40 AM, Paul Moore wrote:

> There *are* some nastily non-intuitive corner cases (for example, if
> from_env={'a':12} and from_config={'a':13}, I don't have any sort of
> intuition as to what a would be in f(**from_env, **from_config). I'd
> go with 12 because the PEP links multiple **-unpackings with
> collections.ChainMap, but I wouldn't dare rely on that guess).

In the your example

  from_env = {'a': 12}
  from_config = {'a': 13}

  f(**from_env, **from_config)

I would think 'a' should be 13, as from_config is processed /after/ from_env.

So which is it?

--
~Ethan~

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-dev/attachments/20150126/eb99480e/attachment.sig>


More information about the Python-Dev mailing list