[Python-Dev] Go \x yourself

M.-A. Lemburg mal@lemburg.com
Mon, 07 Aug 2000 11:15:08 +0200


Greg Ewing wrote:
> 
> BDFL:
> 
> > No, problems with literal interpretations traditionally raise
> > "runtime" exceptions rather than syntax errors.  E.g.
> 
> What about using an exception that's a subclass of *both*
> ValueError and SyntaxError?

What would this buy you ?

Note that the contents of a literal string don't really have
anything to do with syntax. The \x escape sequences are
details of the codecs used for converting those literal
strings to Python string objects.

Perhaps we need a CodecError which is subclass of ValueError
and then make the UnicodeError a subclass of this CodecError ?!

-- 
Marc-Andre Lemburg
______________________________________________________________________
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/