Message323719
| 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:08 | eric.smith | set | recipients:
+ eric.smith, martin.panter, Jason Spencer |
| 2018年08月18日 17:12:08 | eric.smith | set | messageid: <1534612328.33.0.56676864532.issue34425@psf.upfronthosting.co.za> |
| 2018年08月18日 17:12:08 | eric.smith | link | issue34425 messages |
| 2018年08月18日 17:12:08 | eric.smith | create |
|