File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 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(
606606 for writer in writers :
607607 writer .join ()
608608
609- @requires_specialization
609+ @requires_specialization_ft
610610 def test_binary_subscr_getitem (self ):
611611 def get_items ():
612612 class C :
@@ -1242,14 +1242,6 @@ def f(o, n):
12421242 f (test_obj , 1 )
12431243 self .assertEqual (test_obj .b , 0 )
12441244
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-
12531245
12541246class TestSpecializer (TestBase ):
12551247
@@ -1592,7 +1584,13 @@ def binary_subscr_str_int():
15921584 self .assert_no_opcode (binary_subscr_str_int , "BINARY_SUBSCR" )
15931585
15941586 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 )]
15961594 for i in range (100 ):
15971595 self .assertEqual (items [i ][i ], i )
15981596
You can’t perform that action at this time.
0 commit comments