string to type object (C)
gagsl-py2 at yahoo.com.ar
Tue Aug 12 07:37:07 CEST 2008
En Wed, 06 Aug 2008 01:55:10 -0300, castironpi <castironpi at gmail.com>
> Do you know if uncooperative (not necc'ly malicious) code could
>>>> __builtin__.int= None
>>>> __builtin__.int= type( 0 )
> <type 'int'>
> ? Or would PyImport_Import(s) create a namespace that had the int
> type in it from scratch?
Once you modify __builtin__, any later access to builtin names will see
the changed values.
I don't know of any way to "reset" the builtin module - other than calling
again _PyBuiltin_Init from C code.
More information about the Python-list