[Python-ideas] Preserving **kwargs order

random832 at fastmail.us random832 at fastmail.us
Fri Apr 4 15:50:21 CEST 2014


On Fri, Apr 4, 2014, at 4:54, Terry Reedy wrote:
> **kwds in a call is a substitute for writing out unordered key=value 
> specifications. The function may or may not have **kargs in its 
> signature and if it does, the kargs received may or may not be equal to 
> the kwds passed.

The problem is, there is no such thing as "writing out unordered
key=value specifications" - anything that is "written out" has an order
by its nature; the fact that this order is lost immediately is a poor
abstraction. The desired use case is not to preserve the order of
**kwds, it's to preserve the order of a sequence of key=value
specifications.


More information about the Python-ideas mailing list