[Python-checkins] CVS: python/dist/src/Doc/tut tut.tex,1.156.4.1,1.156.4.1.2.1
Fred L. Drake
fdrake@users.sourceforge.net
Tue, 29 Jan 2002 06:54:21 -0800
Update of /cvsroot/python/python/dist/src/Doc/tut
In directory usw-pr-cvs1:/tmp/cvs-serv24819/tut
Modified Files:
Tag: release22-maint
tut.tex
Log Message:
Revise cheeseshop example so that the order of the keyword output is
completely determined by the example; dict insertion order and the string
hash algorithm no longer affect the output.
This fixes SF bug #509281.
Index: tut.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v
retrieving revision 1.156.4.1
retrieving revision 1.156.4.1.2.1
diff -C2 -d -r1.156.4.1 -r1.156.4.1.2.1
*** tut.tex 2001/12/21 03:48:33 1.156.4.1
--- tut.tex 2002/01/29 14:54:18 1.156.4.1.2.1
***************
*** 1486,1490 ****
for arg in arguments: print arg
print '-'*40
! for kw in keywords.keys(): print kw, ':', keywords[kw]
\end{verbatim}
--- 1486,1492 ----
for arg in arguments: print arg
print '-'*40
! keys = keywords.keys()
! keys.sort()
! for kw in keys: print kw, ':', keywords[kw]
\end{verbatim}
***************
*** 1511,1514 ****
--- 1513,1521 ----
sketch : Cheese Shop Sketch
\end{verbatim}
+
+ Note that the \method{sort()} method of the list of keyword argument
+ names is called before printing the contents of the \code{keywords}
+ dictionary; if this is not done, the order in which the arguments are
+ printed is undefined.