lcompilers / lpython

Python compiler
https://lpython.org/
Other
1.37k stars 156 forks source link

Add support for `tuple` and `set` in intrinsic `type(object)` #2687

Closed kmr-srbh closed 1 month ago

kmr-srbh commented 1 month ago
my_tuple: tuple[str, i32] = ("A", 1)
my_set: set[str] = {"A", "B", "C"}

print(type(my_tuple))
print(type(my_set))
(lp) saurabh-kumar@Awadh:~/Projects/System/lpython$ ./src/bin/lpython ./examples/example.py
<class 'tuple'>
<class 'set'>
Shaikh-Ubaid commented 1 month ago

It looks like there is a failure at the CI.

kmr-srbh commented 1 month ago

It looks like there is a failure at the CI.

Yes @Shaikh-Ubaid. It seems we are having empty printf("") statements in the generated code for C back-end. The issue occurs when printing list and tuple. This issue was not present before, but is consistently occurring in the recent PRs related to data-structures.

kmr-srbh commented 1 month ago

Removed the C back-end from tests as set is not implemented for it.