➜

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.

作者 eric.smith
收信人 Jason Spencer, eric.smith, martin.panter
日期 2018-08-18.17:12:08
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1534612328.33.0.56676864532.issue34425@psf.upfronthosting.co.za>
In-reply-to
内容
I agree this is the desired behavior, and not a bug.

Because you are not specifying a __format__ in your class, object.__format__ is being called. By design, it does not understand any formatting specifiers, instead reserving them for your class to implement. "!s" is the correct way to convert your type to a string. Either that, or add a __format__ that understands "s".

Note that not all types understand "s", for example, datetime.
历史
日期 用户 动作 参数
2018-08-18 17:12:08eric.smith修改recipients: + eric.smith, martin.panter, Jason Spencer
2018-08-18 17:12:08eric.smith修改messageid: <1534612328.33.0.56676864532.issue34425@psf.upfronthosting.co.za>
2018-08-18 17:12:08eric.smith链接issue34425 messages
2018-08-18 17:12:08eric.smith创建