[New-bugs-announce] [issue42161] Remove private _PyLong_Zero and _PyLong_One variables

STINNER Victor report at bugs.python.org
Mon Oct 26 17:59:37 EDT 2020


New submission from STINNER Victor <vstinner at python.org>:

In bpo-38858, I made the small integer singletons per interpreter: commit 630c8df5cf126594f8c1c4579c1888ca80a29d59. _PyLong_Zero and _PyLong_One variables are still shared by all interpreters, whereas subinterpreters must not share Python objects: see bpo-40533.

I propose to add new _PyLong_GetZero() and _PyLong_GetOne() functions to replace _PyLong_Zero and _PyLong_One variables. These functions will retrieve the singletons from tstate->interp->small_ints.

----------
components: Interpreter Core
messages: 379691
nosy: vstinner
priority: normal
severity: normal
status: open
title: Remove private _PyLong_Zero and _PyLong_One variables
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42161>
_______________________________________


More information about the New-bugs-announce mailing list