On Sun, Aug 24, 2014 at 1:29 PM, Joshua Landau <jos...@landau.ws> wrote: > > On 24 August 2014 20:25, Joshua Landau <jos...@landau.ws> wrote: > > On 24 August 2014 20:19, Ian Kelly <ian.g.ke...@gmail.com> wrote: > >> On Sun, Aug 24, 2014 at 1:17 PM, Ian Kelly <ian.g.ke...@gmail.com> wrote: > >>> On Sun, Aug 24, 2014 at 1:12 PM, Joshua Landau <jos...@landau.ws> wrote: > >>> > Is math not already imported by start-up? > > > > I don't mean into the global namespace, but imported by other modules > > (like the builtins) and thus cached, making instantiation trivial. > > Although it doesn't seem to be: > > >>> python -c "import sys; print('math' in sys.modules)" > False
That's the same check I posted, just using the in operator instead of a straight lookup and raising an error. > An even easier check: > > >>> python -c "import time; a = time.time(); import math; b = time.time(); print(b-a)" > 0.0006012916564941406 Too dependent on system timings. I get: $ python -c "import time; a = time.time(); import math; b = time.time (); print(b-a)" 0.0
-- https://mail.python.org/mailman/listinfo/python-list