On Tue, Jan 27, 2009 at 9:51 PM, James Mills <prolo...@shortcircuit.net.au> wrote: > On Wed, Jan 28, 2009 at 9:31 AM, Fabio Zadrozny <fabi...@gmail.com> wrote: >> Anyone knows why the code below gives an error? >> >> global_vars = {} >> local_vars = {'ar':["foo", "bar"], 'y':"bar"} >> print eval('all((x == y for x in ar))', global_vars, local_vars) > > y is undefined in your generator expression.
Yes... but why? It seems to me like it should be defined (if I put the locals in the globals it finds it... seems very weird to me) > Why are you using eval ? I'm using it to evaluate what the user entered on a watch expression in the Pydev debugger (bug: https://sourceforge.net/tracker2/?func=detail&aid=2541355&group_id=85796&atid=577329 )... That's just a sample to reproduce it without any dependencies. Cheers, Fabio -- http://mail.python.org/mailman/listinfo/python-list