Question about using python as a scripting language

Slawomir Nowaczyk slawomir.nowaczyk.847 at student.lu.se
Wed Aug 9 09:20:00 EDT 2006


On Tue, 08 Aug 2006 14:32:32 +0200
Wildemar Wildenburger <wildemar at freakmail.de> wrote:

#> Steve Lianoglou wrote:
#> > Delaney, Timothy (Tim) wrote:
#> >> This is just asking for trouble.
#> >>
#> >> my_list = eval('import shutil; shutil.rmtree('/')')
#> > 
#> > Hah .. wow.
#> > 
#> > And in related news: you still shouldn't be taking candy from
#> > strangers.
#> > 
#> > Point well taken. Thanks for flagging that one.
#> 
#> Heck, whenever *is* it OK to use eval() then?

eval is like optimisation. There are two rules:

Rule 1: Do not use it.
Rule 2 (for experts only): Do not use it (yet).

:)

-- 
 Best wishes,
   Slawomir Nowaczyk
     ( Slawomir.Nowaczyk at cs.lth.se )

The good people sleep much better at night than the bad people. Of course,
the bad people enjoy the waking hours much more.




More information about the Python-list mailing list