Working with decimals

Ian Kelly ian.g.kelly at gmail.com
Sun Aug 24 15:40:48 EDT 2014


On Sun, Aug 24, 2014 at 1:29 PM, Joshua Landau <joshua at landau.ws> wrote:
>
> On 24 August 2014 20:25, Joshua Landau <joshua at landau.ws> wrote:
> > On 24 August 2014 20:19, Ian Kelly <ian.g.kelly at gmail.com> wrote:
> >> On Sun, Aug 24, 2014 at 1:17 PM, Ian Kelly <ian.g.kelly at gmail.com>
wrote:
> >>> On Sun, Aug 24, 2014 at 1:12 PM, Joshua Landau <joshua at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20140824/7f17ecda/attachment.html>


More information about the Python-list mailing list