Message151300
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 |
|
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 | |
|