change of random state when pyc created??

Carsten Haese carsten at uniqsys.com
Wed May 9 17:16:18 EDT 2007


On Wed, 2007-05-09 at 15:35 -0500, Alan G Isaac wrote:
> Robert Kern wrote:
> > http://docs.python.org/lib/typesmapping.html
> > """
> > Keys and values are listed in an arbitrary order which is non-random, varies
> > across Python implementations, and depends on the dictionary's history of
> > insertions and deletions.
> > """
> 
> 
> Even this does not tell me that if I use a specified implementation
> that my results can vary from run to run.  That is, it still does
> not communicate that rerunning an *unchanged* program with an
> *unchanged* implementation can produce a change in results.

It doesn't say that rerunning the program won't produce a change in
results. It doesn't say that the order depends *only* on those factors
in a deterministic and reproducible manner.

The documentation shouldn't be expected to list every little thing that
might change the order of keys in a dictionary. The documentation does
say explicitly what *is* guaranteed: Order of keys is preserved as long
as no intervening modifications happen to the dictionary. Tearing down
the interpreter, starting it back up, and rebuilding the dictionary from
scratch is very definitely an intervening modification.

Regards,

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





More information about the Python-list mailing list