This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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:03py.usersetrecipients: + py.user, eric.smith
2012-01-15 22:46:03py.usersetmessageid: <1326667563.92.0.782142630532.issue13790@psf.upfronthosting.co.za>
2012-01-15 22:46:03py.userlinkissue13790 messages
2012-01-15 22:46:03py.usercreate