[Python-Dev] PEP 509 (original) (raw)

Ethan Furman ethan at stoneleaf.us
Tue Jan 12 13:52:24 EST 2016


On 01/12/2016 10:34 AM, Jim J. Jewett wrote:

(1c) Section "Guard against changing dict during iteration" says "Sadly, the dictionary version proposed in this PEP doesn't help to detect dictionary mutation." Why not? Wouldn't that mutation involve replacing a value, which ought to trigger a version change?

Yes it would, but mutating a dictionary value during iteration is legal, so we cannot use the version [1] change to tell us that something illegal happened.

[1] We're not going to call it version are we? Seems like cache_token is a much better name.

-- Ethan



More information about the Python-Dev mailing list