codon
codon copied to clipboard
Is it possible to change variable type in codon?
I have a code (test_condon.py
) like this.
from python import decimal
foo = 1.5
if type(foo) is float:
print('convert float to Decimal')
foo = decimal.Decimal(str(foo))
print('done')
When I run codon run test_codon.py
, I got test_codon.py:4:4-22: error: '__new__[...,...]' does not match expected type 'float'
error.
It seems that I can't change the type of a variable in codon.
Is there any solution to let codon run the above code?
Hi @lyenliang -- this should work, and it does work with the latest unreleased changes, so whatever issue this was seems to have been resolved. We'll be putting out the new version in a week or two which should have this resolved.
@arshajii Thank you for your response. I'm looking forward to the new version of codon.
@arshajii Thank you for the good news! Could you tell me when the new version will be released? I just happen to need this feature!