Message151300
| Author |
py.user |
| Recipients |
eric.smith, py.user |
| Date |
2012年01月15日.22:46:03 |
| SpamBayes Score |
4.893437e-07 |
| Marked as misclassified |
No |
| Message-id |
<1326667563.92.0.782142630532.issue13790@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
also strange(unobvious) behavior:
>>> '{0:.3s}'.format((i for i in (1, 2, 3)))
'<ge'
>>> '{0:.3s}'.format(range(10))
'ran'
>>> '{0:.3s}'.format(None)
'Non'
>>>
it would be better to print an error:
ValueError: Unknown format code 's' for object of type 'generator'
like in this:
>>> '{0:d}'.format(4.5)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Unknown format code 'd' for object of type 'float'
>>>
in the documentation there is nothing about it |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年01月15日 22:46:03 | py.user | set | recipients:
+ py.user, eric.smith |
| 2012年01月15日 22:46:03 | py.user | set | messageid: <1326667563.92.0.782142630532.issue13790@psf.upfronthosting.co.za> |
| 2012年01月15日 22:46:03 | py.user | link | issue13790 messages |
| 2012年01月15日 22:46:03 | py.user | create |
|