File tree 1 file changed +8
-10
lines changed
1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -606,7 +606,7 @@ def assert_races_do_not_crash(
606
606
for writer in writers :
607
607
writer .join ()
608
608
609
- @requires_specialization
609
+ @requires_specialization_ft
610
610
def test_binary_subscr_getitem (self ):
611
611
def get_items ():
612
612
class C :
@@ -1242,14 +1242,6 @@ def f(o, n):
1242
1242
f (test_obj , 1 )
1243
1243
self .assertEqual (test_obj .b , 0 )
1244
1244
1245
- # gh-127274: BINARY_SUBSCR_GETITEM will only cache __getitem__ methods that
1246
- # are deferred. We only defer functions defined at the top-level.
1247
- class CGetItem :
1248
- def __init__ (self , val ):
1249
- self .val = val
1250
- def __getitem__ (self , item ):
1251
- return self .val
1252
-
1253
1245
1254
1246
class TestSpecializer (TestBase ):
1255
1247
@@ -1592,7 +1584,13 @@ def binary_subscr_str_int():
1592
1584
self .assert_no_opcode (binary_subscr_str_int , "BINARY_SUBSCR" )
1593
1585
1594
1586
def binary_subscr_getitems ():
1595
- items = [CGetItem (i ) for i in range (100 )]
1587
+ class C :
1588
+ def __init__ (self , val ):
1589
+ self .val = val
1590
+ def __getitem__ (self , item ):
1591
+ return self .val
1592
+
1593
+ items = [C (i ) for i in range (100 )]
1596
1594
for i in range (100 ):
1597
1595
self .assertEqual (items [i ][i ], i )
1598
1596
You can’t perform that action at this time.
0 commit comments