Closed rebcabin closed 7 months ago
We need to use tuple[i32]
. For example:
% cat examples/expr2.py
from lpython import i32
def foo() -> tuple[i32]:
return (42,)
def main():
print(foo())
if __name__ == "__main__":
main()
% python examples/expr2.py
(42,)
% lpython examples/expr2.py
(42)
Example for returning multiple values:
% cat examples/expr2.py
from lpython import i32
def foo() -> tuple[i32, bool]:
return (42, True)
def main():
print(foo())
if __name__ == "__main__":
main()
% python examples/expr2.py
(42, True)
% lpython examples/expr2.py
(42, True)
thanks !
Works in CPython, fails LPython with an error message.