File tree Expand file tree Collapse file tree 1 file changed +0
-30
lines changed
Expand file tree Collapse file tree 1 file changed +0
-30
lines changed Original file line number Diff line number Diff line change @@ -2286,36 +2286,6 @@ def testfunc(n):
22862286 self .assertNotIn ("_TO_BOOL_BOOL" , uops )
22872287 self .assertIn ("_GUARD_IS_TRUE_POP" , uops )
22882288
2289- def test_call_isinstance_tuple_metaclass (self ):
2290- calls = 0
2291-
2292- class Meta (type ):
2293- def __instancecheck__ (self , _ ):
2294- nonlocal calls
2295- calls += 1
2296- return False
2297-
2298- class Unknown (metaclass = Meta ):
2299- pass
2300-
2301- def testfunc (n ):
2302- x = 0
2303- for _ in range (n ):
2304- # Only narrowed to bool
2305- y = isinstance (42 , (Unknown , int ))
2306- if y :
2307- x += 1
2308- return x , calls
2309-
2310- (res , calls ), ex = self ._run_with_optimizer (testfunc , TIER2_THRESHOLD )
2311- self .assertEqual (res , TIER2_THRESHOLD )
2312- self .assertEqual (calls , TIER2_THRESHOLD )
2313- self .assertIsNotNone (ex )
2314- uops = get_opnames (ex )
2315- self .assertIn ("_CALL_ISINSTANCE" , uops )
2316- self .assertNotIn ("_TO_BOOL_BOOL" , uops )
2317- self .assertIn ("_GUARD_IS_TRUE_POP" , uops )
2318-
23192289 def test_set_type_version_sets_type (self ):
23202290 class C :
23212291 A = 1
You can’t perform that action at this time.
0 commit comments