I've just started working through Dive Into Python, so I don't really have an opinion of the book yet. I did notice that Example 2.1 produces different output on my machine than from the example...
The example says I should get:
server=mpilgrim;uid=sa;database=master;pwd=secret
I get:
pwd=secret;database=master;uid=sa;server=mpilgrim
It's interesting that this is exactly the reverse of what the book says I should get. I have no idea why, as I can't read Python yet, but there you go.
Tags for this post: python(
posted at: 11:16 | path: /python/diveintopython | permanent link to this entry
#1 Stephen Thorne
The dict object is an unordered hashmap. Order of elements returned by dict.items() is random based on factors like python version, method of insertion, and the phase of the moon.
#2 Pascal Klein
I'm going through the same book, right now. On page 16, iirc, and I got the same result for that... =\
[pwd=secret;database=master;uid=sa;server=mpilgrim]
