PEP 509: be more explicit on when the version is incremented or not

This commit is contained in:
Victor Stinner 2016-01-12 00:19:28 +01:00
parent 04b7e969a2
commit a19233d285
1 changed files with 4 additions and 3 deletions

View File

@ -153,9 +153,10 @@ initilized to version ``0``. The version is incremented at each change:
* ``setdefault(key, value)`` if the `key` does not exist
* ``__detitem__(key)`` if the key exists
* ``__setitem__(key, value)`` if the `key` doesn't exist or if the value
is different
* ``update(...)`` if new values are different than existing values (the
version can be incremented multiple times)
is not ``dict[key]``
* ``update(...)`` if new values are different than existing values:
values are compared by identity, not by their content; the version can
be incremented multiple times
Example using an hypothetical ``dict_get_version(dict)`` function::