While thinking of a way to pretty print table header i found that integers are right aligned by default, but strings are left aligned.
For example:
>>> for i in (1,'x',0.0):
... print("{0:5}".format(i))
...
1
x
0.0
This is easily fixed by setting alignment explicitly, but i wonder why is this so?
EDIT:
I am not looking for a way to align strings, it is easy:
>>> for i in (1,'x',0.0):
... print("{0:>5}".format(i))
...
1
x
0.0
I just thought that all objects would be aligned the same way by deafult and i'm asking why is it not so.