GH-111435: Add Support for Sharing True and False Between Interpreters (gh-111436)

This only affects users of the APIs in pycore_crossinterp.h (AKA _xxsubinterpretersmodule.c and _xxinterpchannels.c).
This commit is contained in:
Anthony Shaw 2023-11-02 09:09:01 +09:00 committed by GitHub
parent 9322ce90ac
commit 230e8e924d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 4 deletions

View file

@ -102,6 +102,8 @@ class IsShareableTests(unittest.TestCase):
'spam',
10,
-10,
True,
False,
100.0,
]
for obj in shareables:
@ -121,8 +123,6 @@ class IsShareableTests(unittest.TestCase):
not_shareables = [
# singletons
True,
False,
NotImplemented,
...,
# builtin types and objects
@ -189,6 +189,9 @@ class ShareableTypeTests(unittest.TestCase):
with self.assertRaises(OverflowError):
_testinternalcapi.get_crossinterp_data(i)
def test_bool(self):
self._assert_values([True, False])
def test_float(self):
self._assert_values([0.0, 1.1, -1.0, 0.12345678, -0.12345678])