> So AFAIK, sometimes I've to use eval and sometimes I need exec, > so I use the following code (global / local dictionary parameters are > left out in this example): > > > Is this the (most) correct / elegant way, or are there better solutions ?
You should be using compile with the "single" start symbol, and then use eval on the resulting code option. > I read somewhere that exec is going to disappear, That's not true. exec stops being a statement, and becomes a function (like print). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list