Error messages from format()

Colin J. Williams cjw at ncf.ca
Tue Nov 13 16:08:59 CET 2012


Is there some way to get more informative error messages from the 
builtin format?

Most messages are such as:
Traceback (most recent call last):
   File "<interactive input>", line 1, in <module>
ValueError: Invalid conversion specification

This example doesn't point to the first invalid case.

[Dbg]>>> format((25, 31),'{0^9o} a(1:9x}')
Traceback (most recent call last):
   File "<interactive input>", line 1, in <module>
ValueError: Invalid conversion specification

Basically, I'm trying to make use of the format function with Python 
3.2, but find little in the way of examples in the docs.

Colin W.


More information about the Python-list mailing list