Hi all

This is a bit of trivia, really, as I don't need a solution.

But someone might need it one day, so it is worth mentioning.

>>> '{}'.format(True)
'True'
>>> '{:<10}'.format(True)
'1         '

One might want to format True/False in a fixed width string, but it returns 1/0 instead. Is there any way to make this work?

Frank Millman

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to