change of random state when pyc created??

Robert Kern robert.kern at gmail.com
Thu May 10 12:29:43 EDT 2007


Alan Isaac wrote:
> "Carsten Haese" <carsten at uniqsys.com> wrote in message
> news:mailman.7500.1178771660.32031.python-list at python.org...
>> I was simply pointing out all the ways in which you made it difficult for
> the
>> community to explain your problem.
> 
> And without that community, I would still not have a clue.
> Thanks to all!
> 
>> Please feel free to suggest specific wording changes to make the
> documentation
>> more useful.
> 
> 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 misleading. It only depends on the memory location of the elements if
__hash__() is implemented as id() (the default).

How about this?

"""Never rely on the order of dictionaries and sets."""

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco




More information about the Python-list mailing list