[Python-ideas] Collect **kw arguments as an ordered dictionary
python at rcn.com
Sat Apr 18 00:09:51 CEST 2009
> It would be nice if **kw arguments collected in a function / method signature
> were collected as an ordered dictionary rather than ordinary dictionary.
I think that would be nice, but until ordered dicts get a C implementation,
it might greatly impair performance.
> Main use case, currently (I believe) the odict constructor doesn't guarantee
> to preserve ordering if created with keyword arguments:
That is correct. And so noted in the docs:
> My use case - I'd like to preserve the ordering to reproduce exactly the
> order of arguments for the Mock module representation of the objects
> are used. Because the order of iterating over arguments isn't the same
> as they are passed in representations can't be compared in tests
> reliably across Python versions / implementations.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas