Re: [Python-Dev] (no subject)

2015年2月09日 18:08:17 -0800

On 02/09/2015 05:14 PM, Victor Stinner wrote:
> 
> def partial(func, *args, **keywords):
> def newfunc(*fargs, **fkeywords):
> return func(*(args + fargs), **keywords, **fkeywords)
> ...
> return newfunc
> 
> The new code behaves differently since Neil said that an error is
> raised if fkeywords and keywords have keys in common. By the way, this
> must be written in the PEP.
That line should read
 return func(*(args + fargs), **{**keywords, **fkeywords})
to avoid the duplicate key error and keep the original functionality.
--
~Ethan~

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to