@@ -1054,10 +1054,20 @@ used in the same call, so in practice this confusion does not often arise.
10541054
10551055If the syntax ``**expression `` appears in the function call, ``expression `` must
10561056evaluate to a :term: `mapping `, the contents of which are treated as
1057- additional keyword arguments. If a keyword is already present
1058- (as an explicit keyword argument, or from another unpacking),
1057+ additional keyword arguments. If a parameter matching a key has already been
1058+ given a value (by an explicit keyword argument, or from another unpacking),
10591059a :exc: `TypeError ` exception is raised.
10601060
1061+ When ``**expression `` is used, each key in this mapping must be
1062+ a string.
1063+ Each value from the mapping is assigned to the first formal parameter
1064+ eligible for keyword assignment whose name is equal to the key.
1065+ A key need not be a Python identifier (e.g. ``"max-temp °F" `` is acceptable,
1066+ although it will not match any formal parameter that could be declared).
1067+ If there is no match to a formal parameter
1068+ the key-value pair is collected by the ``** `` parameter, if there is one,
1069+ or if there is not, a :exc: `TypeError ` exception is raised.
1070+
10611071Formal parameters using the syntax ``*identifier `` or ``**identifier `` cannot be
10621072used as positional argument slots or as keyword argument names.
10631073
0 commit comments