Message 151277 - Python tracker (original) (raw)
'{0:d}'.format('a') Traceback (most recent call last): File "", line 1, in ValueError: Unknown format code 'd' for object of type 'str' '{0:d}'.format(1+1j) Traceback (most recent call last): File "", line 1, in ValueError: Unknown format code 'd' for object of type 'complex' '{0:d}'.format([]) Traceback (most recent call last): File "", line 1, in ValueError: Unknown format code 'd' for object of type 'str'
also strange behavior:
'{0:s}'.format((1, 2, 3)) '(1, 2, 3)' '{0:10.5s}'.format([1, 2, 3]) '[1, 2 '