-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug:List to tuple conversion #573
Comments
From Codon stdlib source I see it has On the other side, lists in Codon are hashable (with the hash based on all the values in the list), so they can be used as keys in maps. Any other list that is equal to the key list in the map will match. lst = [1,2,3]
tup = DynamicTuple(lst)
print(lst)
print(tup)
map_lst_key = {lst: 1}
map_tup_key = {tup: 1}
print(map_lst_key)
print(map_tup_key) output
|
Thanks for your answer and mentioning However, |
From the documentation (https://docs.exaloop.io/codon/general/differences):
That's why DynamicTuple exists, and why no convertion of lists to tuples. |
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:
The Python output is obviously
(1, 2)
, but Codon 0.16.3 complains with this error:This is a major nuissance as, many times, lists must be converted to tuples to insert them into dicts.
The text was updated successfully, but these errors were encountered: