, - python. , . Python 3.1, :
def get_builtins():
"""Due to the way Python works, ``__builtins__`` can strangely be either a module or a dictionary,
depending on whether the file is executed directly or as an import. I couldn’t care less about this
detail, so here is a method that simply returns the namespace as a dictionary."""
return getattr( __builtins__, '__dict__', __builtins__ )
, - , Py3 , Py2. " Python X.X" python.org . , ; . , Py2.
__builtins__ thingie, , , Python. sum, max, range , . , . . , ,
G = get_builtins()
G[ 'G' ] = G
G[ 'axe' ] = axe
, . G , G G, G . , . , G , ( ). , , , , . , .
, , . , , : , , ( ) . , . (1) , hah!, (2) , , - , , Python import. import ; . , !
ah , : , , publish() , , , . .
, : , , , ( car s, axe, ). , .
: JSON , : , , , , , , . , .
- , , , .. , , JSON ; , . , , , . .
, . , , . - ( , , , , ..) ( , dict s). , , , , BS, ( , ).
oh , , , - JSON- , ? , ? , ( this )? , , .