On Wed, Sep 28, 2016 at 9:25 PM, Gregory Ewing <greg.ew...@canterbury.ac.nz> wrote: > Chris Angelico wrote: >> >> If you've Py_DECREFed it and then peek into its internals, you're >> aiming a gun at your foot. > > > That's true. A safer way would be to look at the refcount > *before* decreffing and verify that it's what you expect.
Exactly, which is presumably what dieter meant by a refcount of 1 being the one you're holding. A refcount of *2* indicates another reference somewhere. ChrisA -- https://mail.python.org/mailman/listinfo/python-list