Skip to content

Commit 9346547

Browse files
committed
drop bool support
1 parent e8015e3 commit 9346547

File tree

3 files changed

+2
-22
lines changed

3 files changed

+2
-22
lines changed

Lib/test/test_capi/test_opt.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import unittest
66
import gc
77
import os
8-
import warnings
98

109
import _opcode
1110

@@ -2235,23 +2234,6 @@ def testfunc(n):
22352234
self.assertNotIn("_GUARD_TOS_INT", uops)
22362235
self.assertNotIn("_GUARD_NOS_INT", uops)
22372236

2238-
def test_unary_invert_bool_type(self):
2239-
def testfunc(n):
2240-
for _ in range(n):
2241-
a = True
2242-
x = ~a + ~a
2243-
2244-
with warnings.catch_warnings():
2245-
warnings.simplefilter("ignore")
2246-
testfunc(TIER2_THRESHOLD)
2247-
2248-
ex = get_first_executor(testfunc)
2249-
self.assertIsNotNone(ex)
2250-
uops = get_opnames(ex)
2251-
2252-
self.assertNotIn("_GUARD_TOS_INT", uops)
2253-
self.assertNotIn("_GUARD_NOS_INT", uops)
2254-
22552237

22562238
def global_identity(x):
22572239
return x

Python/optimizer_bytecodes.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,7 @@ dummy_func(void) {
468468
}
469469

470470
op(_UNARY_INVERT, (value -- res)) {
471-
PyTypeObject *type = sym_get_type(value);
472-
if (type == &PyLong_Type || type == &PyBool_Type) {
471+
if (sym_matches_type(value, &PyLong_Type)) {
473472
res = sym_new_type(ctx, &PyLong_Type);
474473
}
475474
else {

Python/optimizer_cases.c.h

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)