[BangPypers] magic in datetime module?

Anand Balachandran Pillai abpillai at gmail.com
Fri Apr 3 08:44:21 CEST 2009


On Fri, Apr 3, 2009 at 11:54 AM, Noufal Ibrahim <noufal at gmail.com> wrote:

> > __builtins__ = {'__import__': ximport}
> > f = now.strftime
> > print f("%m %Y")
>
>
> You can get this directly if you use -v.
> Calling strftime imports the time module
> >>> print now.strftime("%m %Y")
> dlopen("/usr/lib/python2.5/lib-dynload/time.so", 2);
> import time # dynamically loaded from
> /usr/lib/python2.5/lib-dynload/time.so
>

I have a basic doubt - why do you want to set a module as core
as __builtins__ to {} in your code ? If you can answer that
reasonably, it makes sense to investigate this or raise a bug.
Otherwise, I don't think it is good coding.


>
>
> --
> ~noufal
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>



-- 
-Anand
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/bangpypers/attachments/20090403/667b3b8d/attachment.htm>


More information about the BangPypers mailing list