string to type object (C)

Gabriel Genellina gagsl-py2 at
Tue Aug 12 07:37:07 CEST 2008

En Wed, 06 Aug 2008 01:55:10 -0300, castironpi <castironpi at>  

> Do you know if uncooperative (not necc'ly malicious) code could
> interfere:
>>>> None
>>>> 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.

Gabriel Genellina

More information about the Python-list mailing list