vasudevram wrote:
> Hi group,
> 
> Question: Do eval() and exec not accept a function definition? (like
> 'def foo: pass) ?

def is the first keyword in a _statement_, not an expression.

exec executes statements, eval evaluates expressions.

try this:

     exec "def foolish(x):\n    y= x * 2\n    print x, y"
     foolish(2.4)


-- 
--Scott David Daniels
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to