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 vstinner
Recipients Mark.Shannon, eric.snow, erlendaasland, vstinner
Date 2022-01-17.17:31:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1642440683.94.0.422015474021.issue45691@roundup.psfhosted.org>
In-reply-to
Content
> `sys.float_info.n_unnamed_fields` causes a memory violation if the per-interpreter allocated 0 held by sys.float_info.n_unnamed_fields is freed.
> If it is not freed, then `sys.float_info.n_unnamed_fields is 0` is False, meaning that there are two zeros present.

Python 3.9 and 3.10 are concerned by this issue: integer singletons are per-interpreter since Python 3.9.

Should Python 3.9 and 3.10 be fixed? "x is 0" is recommended and should be used. For example, the compiler emits a SyntaxWarning:

$ python3.9
>>> x=0
>>> x is 0
<stdin>:1: SyntaxWarning: "is" with a literal. Did you mean "=="?
True

I propose to only fix the main branch and so close the issue.
History
Date User Action Args
2022-01-17 17:31:24vstinnersetrecipients: + vstinner, Mark.Shannon, eric.snow, erlendaasland
2022-01-17 17:31:23vstinnersetmessageid: <1642440683.94.0.422015474021.issue45691@roundup.psfhosted.org>
2022-01-17 17:31:23vstinnerlinkissue45691 messages
2022-01-17 17:31:23vstinnercreate