This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lrekucki
Recipients georg.brandl, lrekucki
Date 2010-01-06.00:32:39
SpamBayes Score 1.2847054e-05
Marked as misclassified No
Message-id <1262737962.32.0.137160455092.issue7641@psf.upfronthosting.co.za>
In-reply-to
Content
The documentation states: "Most built-in types implement the following options for format specifications, although some of the formatting options are only supported by the numeric types."

The list doesn't include "s" presentation type, which is actually accepted for most built-in types *except* numeric ones. So you can write:
>>> "{:s}".format([])"
'[]'

But with numeric types you have to explicitly convert:
>>> "{!s:s}".format(5)
'5'
>>> "{:s}".format(5) # fails
History
Date User Action Args
2010-01-06 00:32:43lrekuckisetrecipients: + lrekucki, georg.brandl
2010-01-06 00:32:42lrekuckisetmessageid: <1262737962.32.0.137160455092.issue7641@psf.upfronthosting.co.za>
2010-01-06 00:32:40lrekuckilinkissue7641 messages
2010-01-06 00:32:39lrekuckicreate