eval all True builtins __builtins__ __dict__ copy del builtins all eva

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
>>> eval('all([1,1,1,1])')
True
>>> builtins = __builtins__.__dict__.copy()
>>> del builtins['all']
>>> eval('all([1,1,1,1])', {'__builtins__': builtins})
---------------------------------------------------------------------------
<type 'exceptions.NameError'> Traceback (most recent call last)
C:\Documents and Settings\murkt\<ipython console> in <module>()
C:\Documents and Settings\murkt\<string> in <module>()
<type 'exceptions.NameError'>: name 'all' is not defined