Why I can call 'print' from 'eval'

前端 未结 4 523
夕颜
夕颜 2021-02-06 09:15

For code:

#!/usr/bin/python

src = \"\"\"
print \'!!!\'
import os
\"\"\"

obj = compile(src, \'\', \'exec\')
eval(obj, {\'__builtins__\': False})
4条回答
提交回复
热议问题