codon
codon copied to clipboard
String format not supported
% codon --version
0.15.5
% echo 'print("hello")' | codon run
hello
% echo 'print("{}".format(1.23))' | codon run
<stdin>:1:7-24: error: 'str' object has no attribute 'format'
Thanks for the report -- we do plan to add this in a future version. For now f-strings can be used as a workaround:
x = 1.23
print(f"hello {x:.6f} world") # hello 1.230000 world
I've experienced the same issue and appreciate the workaround. I'm hopeful that a permanent fix will be available soon.