[Checkins] SVN: Sandbox/malthe/chameleon.genshi/src/chameleon/genshi/language.txt Sort dictionary items; Python does not guarantee an ordering.
Malthe Borch
mborch at gmail.com
Thu Nov 20 10:38:00 EST 2008
Log message for revision 93176:
Sort dictionary items; Python does not guarantee an ordering.
Changed:
U Sandbox/malthe/chameleon.genshi/src/chameleon/genshi/language.txt
-=-
Modified: Sandbox/malthe/chameleon.genshi/src/chameleon/genshi/language.txt
===================================================================
--- Sandbox/malthe/chameleon.genshi/src/chameleon/genshi/language.txt 2008-11-20 15:36:18 UTC (rev 93175)
+++ Sandbox/malthe/chameleon.genshi/src/chameleon/genshi/language.txt 2008-11-20 15:38:00 UTC (rev 93176)
@@ -98,7 +98,7 @@
>>> print render("""\
... <ul xmlns="http://www.w3.org/1999/xhtml"
... xmlns:py="http://genshi.edgewall.org/">
- ... <li py:for="(key,value) in dict(one=1,two=2,three=3).items()">${key}=$value</li>
+ ... <li py:for="(key,value) in sorted(dict(one=1,two=2,three=3).items(), key=lambda (k,v): (v,k))">${key}=$value</li>
... </ul>""")
<ul>
<li>one=1</li>
More information about the Checkins
mailing list