Safe to import __builtin__ ?

mrstevegross mrstevegross at gmail.com
Wed Jun 3 23:33:02 CEST 2009


> Yes, it's safe (and this is what the ‘__builtin__’ module is intended
> for: <URL:http://docs.python.org/library/__builtin__>).
>
> Be careful, though: there's a separate name, ‘__builtins__’, that is
> *not* meant to be imported. It's also implementation-specific, so
> shouldn't be relied upon. My advice: don't use ‘__builtins__’ at all,
> but be aware that it exists so you spell ‘__builtin__’ correctly.
>

Thanks

--Steve



More information about the Python-list mailing list