[Tutor] Turning a string into a tuple? (Without eval?)

Kirby Urner urnerk@qwest.net
Fri, 28 Sep 2001 16:24:39 -0700


Very impressive Blake!

But does it handle:

[why did it cut off before, will it do so again...?]

=====

   >>> f = lambda x: x*x
   >>> qlist = "[f]"
   >>> eval(qlist)
   [<function <lambda> at 00B2C61C>]

=====

?  :-D

I think eval(x) isn't so bad if its arg isn't wholly
left up to some remote user via cgi or something (cite
Danny's comments).  That'd be sloppy programming style.

But eval() can be insulated, and many (most) programs
don't have anything to do with remote users with a
malicious bent (including ones you download).

All worthy interpreted languages have something similar,
no?

Kirby