Issue 7641: Built-in Formatter accepts undocumented presentation type (original) (raw)

Issue7641

Created on 2010-01-06 00:32 by lrekucki, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg97284 - (view) Author: Ɓukasz Rekucki (lrekucki) Date: 2010-01-06 00:32
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
msg97285 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2010-01-06 01:00
This is a duplicate of issue 5965.
History
Date User Action Args
2022-04-11 14:56:56 admin set github: 51890
2010-01-06 01:00:15 eric.smith set status: open -> closedresolution: duplicatemessages: +
2010-01-06 00:58:39 eric.smith set nosy: + eric.smith
2010-01-06 00:32:40 lrekucki create