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

Chris Angelico rosuav at gmail.com
Sun Jan 10 19:27:45 EST 2016


On Mon, Jan 11, 2016 at 11:15 AM, Victor Stinner
<victor.stinner at gmail.com> wrote:
> * the behaviour on integer overflow is an implementation detail, it's
> sad to have to describe it in the specification of a *Python*
> property. Users expect Python to abtract the hardware

Compromise: Document that it's an integer that changes every time the
dictionary is changed, and has a "vanishingly small chance" of ever
reusing a number. It'll trap the same people who try to use id(obj) as
a memory address, but at least it'll be documented as false.

ChrisA


More information about the Python-ideas mailing list