Embedding Python in Python

Jack Diederich jack at performancedrivers.com
Wed Aug 18 17:10:46 EDT 2004


On Wed, Aug 18, 2004 at 08:25:04PM +0000, JCM wrote:
> Jack Diederich <jack at performancedrivers.com> wrote:
> > On Wed, Aug 18, 2004 at 07:44:47PM +0000, JCM wrote:
> ...
> >> I don't think it's as difficult as you think.  Your snippet of code
> >> would be rejected by the rules I suggested.  You'd also want to
> >> prohibit other builtins like compile, execfile, input, reload, vars,
> >> etc.
> >> 
> > foo = "ev" + "al"
> > e = vars()['__builtins__'].__dict__[foo]
> > print e('2+2')
> 
> Also would be rejected by my original set of rules (can't use
> __dict__).  But I'd disallow vars too.

Google groups for this topic, it's been dead horse kicked.
You would have to eliminate getarr too and any C func that can
result in an infite loop.  

Not-python's-job-ly,

-Jack



More information about the Python-list mailing list