counting references to an instance
tjreedy at udel.edu
Fri Feb 6 19:20:57 CET 2004
"Michael Hudson" <mwh at python.net> wrote in message
news:m34qu45unv.fsf at pc150.maths.bris.ac.uk...
> "Delaney, Timothy C (Timothy)" <tdelaney at avaya.com> writes:
> > > From: Gerrit
> > > IIRC, Python keeps references of all small integers,
> > > apparantly all smaller than 100.
This should have said "CPython ..." since this is implementation-specific
speedup and not part of the language spec.
> > Actually -1 through to 99.
This was true for CPython 1.4 when I tested.
> Um, this is rank pedantry, but it's -5 to 99...
in the current version (and perhaps since some years)
> >>> (0 - 5) is -5
> >>> (0 - 6) is -6
Message: undocumented implementation features can silently change and
should not be depended on (or expoused) without current verification ;-).
Terry J. Reedy
More information about the Python-list