mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
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:
parent
9322ce90ac
commit
230e8e924d
4 changed files with 33 additions and 4 deletions
|
@ -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])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue