Hacker News new | ask | show | jobs
by wging 4742 days ago
This SyntaxErrors for me.

    >>> from types import *
    >>> mycode = "a = int(raw_input()); print a * 2; return a"
    >>> myfunc = FunctionType(compile(mycode,"<string>","exec"), globals())
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "<string>", line 1
    SyntaxError: 'return' outside function
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "<string>", line 1
    SyntaxError: 'return' outside function