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.

Why are you using eval ?

cheers
James
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to