[Python-Dev] PEP 509: Add a private version to dict (original) (raw)

Victor Stinner victor.stinner at gmail.com
Wed Jan 20 19:23:44 EST 2016


2016-01-21 1:08 GMT+01:00 Brett Cannon <brett at python.org>:

On Wed, 20 Jan 2016 at 15:46 Victor Stinner <victor.stinner at gmail.com>

The worst case is when a value different than the watched value is modified between each guard check. In this case, we always need a dict lookup. An heuristic can be chosen to decide to give up after N tries. Currently, fat.GuardDict always retries. Does "retries" mean "check if the value really changed, and if it hasn't then just update the version ID the guard checks"?

If the dict version changes (because a value different than the watched value is modified) each time that the guard is checked, the guard always require a dict lookup to check if the watched value changed.

Victor



More information about the Python-Dev mailing list