Open wixette opened 2 years ago
And, given we have already provided the print()
function, we need to consider Python template strings seriously sooner or later:
'Hello, %s' % name
'Hey %s, there is a 0x%x error!' % (name, errno)
'Hey %(name)s, there is a 0x%(errno)x error!' % { "name": name, "errno": errno }
'Hello, {}'.format(name)
'Hey {name}, there is a 0x{errno:x} error!'.format(name=name, errno=errno)
f'Hello, {name}!'
f"Hey {name}, there's a {errno:#x} error!"
This will be a big task. Above all these forms, maybe we can only support one or two of them.
Without the following basic type conversion functions
It's hard to complete many simple tasks. For example, since SeedPython hasn't supported
yet, it's hard to mix strings and numbers in a single output line with the print() function like:
Given there is no
f''
template string, the following statement can be an alternative way for those cases:Supporting basic type conversion functions will enable many possibilities.
BTW,
repr()
should be another story, which we can consider later, I think.