#NEWLINE# @ tag ( 'important' ) #NEWLINE# def test_index( self ) : #NEWLINE# #INDENT# pyfunc = tuple_index #NEWLINE# cr = compile_isolated ( pyfunc , [ types . UniTuple ( types . int64 , 3 ) , types . int64 ] ) #NEWLINE# tup = ( 4 , 3 , 6 ) #NEWLINE# for i in range ( len ( tup ) ) : #NEWLINE# #INDENT# self . assertPreciseEqual ( cr . entry_point ( tup , i ) , tup [ i ] ) #NEWLINE# #UNINDENT# pyfunc = tuple_index_static #NEWLINE# for typ in ( types . UniTuple ( types . int64 , 4 ) , types . Tuple ( ( types . int64 , types . int32 , types . int64 , types . int32 ) ) ) : #NEWLINE# #INDENT# cr = compile_isolated ( pyfunc , ( typ , ) ) #NEWLINE# tup = ( 4 , 3 , 42 , 6 ) #NEWLINE# self . assertPreciseEqual ( cr . entry_point ( tup ) , pyfunc ( tup ) ) #NEWLINE# #UNINDENT# typ = types . UniTuple ( types . int64 , 1 ) #NEWLINE# with self . assertTypingError ( ) : #NEWLINE# #INDENT# cr = compile_isolated ( pyfunc , ( typ , ) )