[Tutor] PYTHONHASHSEED, -R

eryksun eryksun at gmail.com
Mon Jul 29 23:07:40 CEST 2013


On Mon, Jul 29, 2013 at 12:44 PM, Steven D'Aprano <steve at pearwood.info> wrote:
>>> a single pass, looking for non-NULL values. I'm no language lawyer,
>>> but it seems the wording in the docs under the description of views
>>> guarantees that this is true across Python implementations:
>>>
>>> http://docs.python.org/2.7/library/stdtypes.html#dictionary-view-objects
>
> Even before views, it has been a guarantee going as far back as I can
> remember that keys(), values() and items() will operate in the same order so
> long as they are called without modifying the dict between calls.

I didn't mean to imply it has anything particularly to do with views.
That's just where I found the wording I was looking for in the docs.
dict views are stateless (they only have a pointer to the dict) and
don't actually have intimate knowledge of the hash table; they create
new sets and iterators and use abstract methods. Only the iterator
objects work directly with the table.


More information about the Tutor mailing list