change of random state when pyc created??

Hamilton, William whamil1 at entergy.com
Thu May 10 09:01:36 EDT 2007


> From: Alan Isaac
> 
> I'm sure my first pass will be flawed, but here goes:
> 
> http://docs.python.org/lib/typesmapping.html:
> to footnote (3), add phrase "which may depend on the memory location of
> the
> keys" to get:
> 
>     Keys and values are listed in an arbitrary order,
>     which may depend on the memory location of the keys.
>     This order is non-random, varies across Python implementations,
>     and depends on the dictionary's history of insertions and deletions.
> 
> http://docs.python.org/lib/types-set.html: append a new sentence to 2nd
> paragraph
> 
>     Iteration over a set returns elements in an arbitrary order,
>     which may depend on the memory location of the elements.

It's possible there are other factors that can affect this as well.  A more
general statement is probably more appropriate:

"Keys and values are listed in an arbitrary order.  This order is
non-random, varies across Python implementations, and depends on the
dictionary's history of insertions and deletions as well as factors outside
the scope of the containing program."

"Iteration over a set returns elements in an arbitrary order, which may
depend on factors outside the scope of the containing program."

---
-Bill Hamilton



More information about the Python-list mailing list