codon icon indicating copy to clipboard operation
codon copied to clipboard

Bug:List to tuple conversion

Open jordi-petit opened this issue 6 months ago • 4 comments

Dear developers,

It seems to me that Codon is unable to perform a simple conversion from a list to a tuple. Here is a minimal example:

l = [1, 2]
t = tuple[int, int](l)
print(t)

The Python output is obviously (1, 2), but Codon 0.16.3 complains with this error:

b.py:2:5-23: error: 'Tuple[int,int]' object has no method '__new__' with arguments (List[int])

This is a major nuissance as, many times, lists must be converted to tuples to insert them into dicts.

jordi-petit avatar Aug 01 '24 09:08 jordi-petit