Message313288
| Author |
josh.r |
| Recipients |
josh.r |
| Date |
2018年03月05日.21:29:44 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1520285384.69.0.467229070634.issue33002@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
To be clear, this is a problem with old-style (printf-style) formatting, and applies to both bytes formatting and str formatting. So a class like:
class Foo:
def __index__(self):
return 1
will fail with a TypeError should you do any of:
'%o' % Foo()
'%x' % Foo()
'%X' % Foo()
b'%o' % Foo()
b'%x' % Foo()
b'%X' % Foo()
even though hex(Foo()) and oct(Foo()) work without issue. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2018年03月05日 21:29:44 | josh.r | set | recipients:
+ josh.r |
| 2018年03月05日 21:29:44 | josh.r | set | messageid: <1520285384.69.0.467229070634.issue33002@psf.upfronthosting.co.za> |
| 2018年03月05日 21:29:44 | josh.r | link | issue33002 messages |
| 2018年03月05日 21:29:44 | josh.r | create |
|