Scott David Daniels <scott.dani...@acm.org> writes: > And I curse such uses, since I don't get to see the troublesome value, > or why it is troublesome. In the above case, y = sqrt(x) at least > raises ValueError('math domain error'), which is more information than > you are providing. > > How about: > if x >= 0: raise ValueError('x = %r not allowed (negative)?' % x)
Better still in these situations is to throw to pdb. But yes, you can put a formatted string in a check message. -- http://mail.python.org/mailman/listinfo/python-list