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 eric.smith
Recipients Jason Spencer, eric.smith, martin.panter
Date 2018-08-18.17:12:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1534612328.33.0.56676864532.issue34425@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-08-18 17:12:08eric.smithsetrecipients: + eric.smith, martin.panter, Jason Spencer
2018-08-18 17:12:08eric.smithsetmessageid: <1534612328.33.0.56676864532.issue34425@psf.upfronthosting.co.za>
2018-08-18 17:12:08eric.smithlinkissue34425 messages
2018-08-18 17:12:08eric.smithcreate