David Brown wrote: > On Sat, Aug 30, 2008 at 06:10:27PM -0700, James G. Sack (jim) wrote: > >> So I wonder if is this the canonical way to do this kind of thing, or is >> there a better way? > > Almost universally, 'eval' is never the correct answer. You're asking > the language to compile something at runtime, from source. Unless you > evaluating expressions that came from the user, this isn't the best > way to do this. If you are evaluating expressions from the user, you > shouldn't be using eval for safety reasons. > > What is it you are trying to do?
Actually, I was just trying to write a test program to demonstrate invertability of the unicodedata.name() return via eval'ing the composed literal like u'\N{LATIN SMALL LETTER O WITH DIAERESIS}'. Regards, ..jim -- KPLUG-List@kernel-panic.org http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list