I'm trying to understand the following behavior of f-strings in Python:
The following line in which the tuple value is converted explicitly via str() works fine.
f"{str((1,2,3)):>10}"
However if I drop the explicit conversion the line raises a TypeError: unsupported format string passed to tuple.__format__:
f"{(1,2,3):>20}"
There are no issues when there isn't any formatting given:
f"{(1,2,3)}"
I had expected that the f-string converts the tuple into a string automagically and then enforces the formatting requirements. This does not seem to be the case. Can somebody explain? Is there another workaround other then the explicit conversion via str()?