Closed kmr-srbh closed 1 month ago
from lpython import i32, f64 my_first_tuple: tuple[i32, str, f64] = (1, "hello", 2.4) print(my_first_tuple) my_second_tuple: tuple[tuple[i32, str], str] = ((1, "hello"), "world") print(my_second_tuple)
(base) saurabh-kumar@Awadh:~/Projects/System/lpython$ ./src/bin/lpython ./examples/example.py --show-python def __main__global_init(): my_first_tuple = (1, "hello", 2.400000) my_second_tuple = ((1, "hello"), "world") def __main__global_stmts(): print(my_first_tuple) print(my_second_tuple)
from lpython import i32, f64 def f(): my_first_tuple: tuple[i32, str, f64] = (1, "hello", 2.4) print(my_first_tuple) my_second_tuple: tuple[tuple[i32, str], str] = ((1, "hello"), "world") print(my_second_tuple) f()
(base) saurabh-kumar@Awadh:~/Projects/System/lpython$ ./src/bin/lpython ./examples/example.py --show-python def __main__global_stmts(): f() def f(): my_first_tuple: tuple[i32, str, f64] my_second_tuple: tuple[tuple[i32, str], str] my_first_tuple = (1, "hello", 2.400000) print(my_first_tuple) my_second_tuple = ((1, "hello"), "world") print(my_second_tuple)
See: https://github.com/lcompilers/lpython/pull/2690#discussion_r1595612282
Closing due to https://github.com/lcompilers/lpython/pull/2690#issuecomment-2102941947
Global scope
Local scope
TODO