Steve Poe wrote:
Hi tutor list,
In dictionaries, I know that the keys are immutable, and the values
can change What about the place/order of the key/order? I thought
that they were sequential and they do not change.
You were wrong :)
A lot of electronic ink has been spilt on this subject
over the years, and if you Google for things like
"python ordered dictionary" you'll find various
discussions and implementations.
In CPython dictionaries won't generally change order
if nothing's inserted or changed. But you certainly don't
want to rely on that as a characteristic. A Python
dictionary is considered inherently unordered (rather
like a set).
TJG
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor