On Sun, Aug 31, 2008 at 11:48:46AM -0700, James G. Sack (jim) wrote:

But for the record, I was trying to evaluate a string containing an
escape sequence. Composing the escape sequence programmatically was the
starting point.

It's actually a good example because it is hard to to find a good use
of 'eval' that isn't better implemented some other way.  In this
particular case, you wanted to find out what the parser itself did,
which is exactly what 'eval' is for.

Also, unicodedata.lookup() can convert the named representations into
Unicode characters, and would be better to use in a real program.

David


--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to