[Python-ideas] RFC: PEP: Add dict.__version__

Serhiy Storchaka storchaka at gmail.com
Sat Jan 9 03:57:42 EST 2016


On 09.01.16 09:43, Nick Coghlan wrote:
> If we followed the same reasoning for Victor's proposal, then a
> suitable attribute name would be "__cache_token__".

LGTM.

>> This also can be used for better detecting dict mutating during iterating:
>> https://bugs.python.org/issue19332.
>
> I initially thought the same thing, but the cache token will be
> updated even if the keys all stay the same, and one of the values is
> modified, while the mutation-during-iteration check is aimed at
> detecting changes to the keys, rather than the values.

This makes Raymond's objections even more strong.



More information about the Python-ideas mailing list