On Sun, Mar 8, 2015, at 22:09, Ben Finney wrote: > Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> writes: > > > '\udd00' should be a SyntaxError. > > I find your argument convincing, that attempting to construct a Unicode > string of a lone surrogate should be an error. > > Shouldn't the error type be a ValueError, though? The statement is not, > to my mind, erroneous syntax.
In this hypothetical, it's a problem with evaluating a literal - in the same way that '\U12345', or '\U00110000, is. -- https://mail.python.org/mailman/listinfo/python-list