Re: executing arbitrary statements

2011-10-03 Thread Jonathan Hartley
Fair points Steven. Thanks for further refining my initial refinement. :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: executing arbitrary statements

2011-10-02 Thread Steven D'Aprano
Jonathan Hartley wrote: > I (and many others) entirely avoid using 'eval' in all my code for many > years, based on the security concerns that Chris rightly highlights. It's > worth noting though, that RaymondH's talks last year on some valid uses of > 'eval' and 'exec' have opened my eyes to it s

Re: executing arbitrary statements

2011-10-02 Thread Jonathan Hartley
On Saturday, October 1, 2011 8:06:43 AM UTC+1, Chris Rebert wrote: > On Fri, Sep 30, 2011 at 11:31 PM, Jason Swails wrote: > > I'm probably missing something pretty obvious, but I was wondering if there > > was a way of executing an arbitrary line of code somehow (such as a line of > > code based

Re: executing arbitrary statements

2011-10-01 Thread Chris Rebert
On Fri, Sep 30, 2011 at 11:31 PM, Jason Swails wrote: > Hello everyone, > > I'm probably missing something pretty obvious, but I was wondering if there > was a way of executing an arbitrary line of code somehow (such as a line of > code based on user-input).  There's the obvious use of "eval" that

executing arbitrary statements

2011-09-30 Thread Jason Swails
Hello everyone, I'm probably missing something pretty obvious, but I was wondering if there was a way of executing an arbitrary line of code somehow (such as a line of code based on user-input). There's the obvious use of "eval" that will evaluate a function call, but that doesn't allow all thing