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