Legitimate to raise SyntaxError for non-Python syntax errors?

Hamish Lawson hamish_lawson at yahoo.co.uk
Fri Jun 22 05:15:58 EDT 2001

Is it legitimate to use the SyntaxError exception for non-Python
syntax errors, say by a parser when it encounters violations in the
syntax of the data format or mini-language it is parsing? I'd always
assumed that SyntaxError was meant for just Python syntax errors, but
when I found a respected member of the Python community using it in
the broader sense I outlined above, it made me wonder if this broader
usage of SyntaxError is in fact considered legitimate.

Hamish Lawson

More information about the Python-list mailing list