error messages raised by python got me thinking.

Delaney, Timothy tdelaney at avaya.com
Mon Oct 22 20:27:45 EDT 2001


> 	>>> f+h+g+i
> 	Traceback (most recent call last):
>   	File "<stdin>", line 1, in ?
> 	TypeError: coercing to Unicode: need string or buffer: 
> int found at position 3  # I just made this up

I don't see how this could be possible. Addition always occurs on two
operands - so the best that could be specified would be the types of the
operands on either side of the operator.

Much the same information would be conveyed though if, in addition to the
line number, the column number were also displayed in the traceback.

Tim Delaney




More information about the Python-list mailing list