Message279787
| Author |
serhiy.storchaka |
| Recipients |
berker.peksag, eric.smith, ned.deily, python-dev, r.david.murray, serhiy.storchaka, socketpair, vstinner |
| Date |
2016年10月31日.12:56:51 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1477918611.43.0.136994757488.issue28385@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
But on other hand, the error depends on the value of format specifier:
>>> format('abc', '')
'abc'
>>> format('abc', 'j')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Unknown format code 'j' for object of type 'str'
>>> format([1, 2, 3], '')
'[1, 2, 3]'
>>> format([1, 2, 3], 'j')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported format string passed to list.__format__
If keep TypeError I think it would be better to restore former error message "non-empty format string". |
|