<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18702">
<STYLE></STYLE>
</HEAD>
<BODY background="" bgColor=#ffffff><FONT size=2 face=Arial></FONT>
<DIV><BR><FONT size=2 face=Arial>[Michael Foord]</FONT></DIV>
<DIV><FONT size=2 face=Arial>> It would be nice if **kw arguments collected
in a function / method signature</FONT></DIV>
<DIV><FONT size=2 face=Arial>> were collected as an ordered dictionary
rather than ordinary dictionary.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>I think that would be nice, but until ordered dicts
get a C implementation,</FONT></DIV>
<DIV><FONT size=2 face=Arial>it might greatly impair performance.</DIV>
<DIV><BR><BR>> Main use case, currently (I believe) the odict constructor
doesn't guarantee </FONT></DIV>
<DIV><FONT size=2 face=Arial>> to preserve ordering if created with keyword
arguments: </FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>That is correct. And so noted in the
docs:</DIV>
<DIV><BR> <A
href="http://docs.python.org/dev/library/collections.html#ordereddict-objects">http://docs.python.org/dev/library/collections.html#ordereddict-objects</A><BR><BR><BR>>
My use case - I'd like to preserve the ordering to reproduce exactly the </DIV>
<DIV>> order of arguments for the Mock module representation of the objects
</DIV>
<DIV>> are used. Because the order of iterating over arguments isn't the same
</DIV>
<DIV>> as they are passed in representations can't be compared in tests
</DIV>
<DIV>> reliably across Python versions / implementations.</DIV>
<DIV> </DIV>
<DIV>Sounds reasonable.<BR><BR></DIV>
<DIV>Raymond</DIV></FONT></BODY></HTML>