change of random state when pyc created??

Carsten Haese carsten at uniqsys.com
Thu May 10 09:29:20 EDT 2007


On Thu, 2007-05-10 at 08:01 -0500, Hamilton, William wrote:
> 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."

I think we should remove any implied reliability and slash it down to
this:

"Keys and values are listed in an arbitrary order that is random except
that if items(), keys(), values(), iteritems(), iterkeys(), and
itervalues() are called with no intervening modifications to the
dictionary, the lists will directly correspond."

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

And this: "Iteration over a set returns elements in random order."

Regards,

-- 
Carsten Haese
http://informixdb.sourceforge.net





More information about the Python-list mailing list