File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 209209L6:
210210 return r3
211211
212+ [case testTupleOperatorInFinalTuple]
213+ from typing import Final
214+
215+ tt: Final = (1, 2)
216+
217+ def f(x: int) -> bool:
218+ return x in tt
219+ [out]
220+ def f(x):
221+ x :: int
222+ r0 :: tuple[int, int]
223+ r1 :: bool
224+ r2, r3 :: object
225+ r4 :: i32
226+ r5 :: bit
227+ r6 :: bool
228+ L0:
229+ r0 = __main__.tt :: static
230+ if is_error(r0) goto L1 else goto L2
231+ L1:
232+ r1 = raise NameError('value for final name "tt" was not set')
233+ unreachable
234+ L2:
235+ r2 = box(int, x)
236+ r3 = box(tuple[int, int], r0)
237+ r4 = PySequence_Contains(r3, r2)
238+ r5 = r4 >= 0 :: signed
239+ r6 = truncate r4: i32 to builtins.bool
240+ return r6
241+
212242[case testTupleBuiltFromList]
213243def f(val: int) -> bool:
214244 return val % 2 == 0
You can’t perform that action at this time.
0 commit comments