This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mdk
Recipients Mark.Shannon, brandtbucher, eric.snow, gvanrossum, mdk, miss-islington, vstinner
Date 2022-03-29.07:04:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1648537449.69.0.771214976456.issue45953@roundup.psfhosted.org>
In-reply-to
Content
> Since you seem to be challenging the value of 999999999, my question to you is, why do you care what the refcount of 1 is?

Yesterday I was teaching Python, and we were speaking of integer immutability, names being "labels to objects" and so on, and I was showing the memory layout of all of this by hand on a whiteboard while "prooving" my drawings using an interpreter.

While doing so came a question like "So, many modules can use the object int(1)?" So I answered yes, told that I expected many reuse of 1, and went importing sys.getrefcount to show them.

And boom, it printed 1000000209 so I bugged for a few seconds, the value was obviously not the real refcount, and was also obviously bumped by a constant like 100000000, so I went inspecting why and found this commit.

I have nothing against keeping 999999999, but in the other hand it could surprise other people, maybe we should at least document it near sys.getrefcount.
History
Date User Action Args
2022-03-29 07:04:09mdksetrecipients: + mdk, gvanrossum, vstinner, Mark.Shannon, eric.snow, miss-islington, brandtbucher
2022-03-29 07:04:09mdksetmessageid: <1648537449.69.0.771214976456.issue45953@roundup.psfhosted.org>
2022-03-29 07:04:09mdklinkissue45953 messages
2022-03-29 07:04:09mdkcreate