Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'operator': 0.03; 'imported': 0.09; 'lookup': 0.09; 'python': 0.11; '>>': 0.16; '24,': 0.16; 'be:': 0.16; 'namespace,': 0.16; 'posted,': 0.16; 'wrote:': 0.18; 'dependent': 0.19; '>>>': 0.22; 'import': 0.22; 'aug': 0.22; 'email addr:gmail.com>': 0.22; '>>>': 0.24; 'math': 0.24; '>': 0.26; 'header:In- Reply-To:1': 0.27; 'thus': 0.29; "doesn't": 0.30; '(like': 0.30; 'message-id:@mail.gmail.com': 0.30; 'easier': 0.31; 'time;': 0.31; 'subject:with': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'false': 0.36; 'raising': 0.36; 'error.': 0.37; 'too': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'even': 0.60; 'ian': 0.60; 'august': 0.61; 'making': 0.63 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=pyuhuf0uWPrqhAexpiNz9joxurDBWeozUucxrmnrYC0=; b=S0TaEZgQxUPb21JglOQ01/mq52EkaeXUmXcVpoi2zthFQDWI7pC/wjYM4fR/gPYsHQ seu8VXFe12QFluFuO7kIYnvGFFyseb3Ue+2kdf4UeWlkvoKcsMa36CtZ5ex3LpTfX8+D vjJ84HV7wWITy5hdhVi0sLsgf4ri/EmiUI4KS5hrNWwy062VwGwpGowUCQPuVyZzxt+J ci4XmkVJX1ImubzFZSwQTBf/ToGido+HMsROwTQitf+KGfeKbGxCb5F2/a/dgPF8FYZu WDIPRE8FD33O/QMdAEe4ahakYnxcUN73FWXysHubWNOa3zhi3djOIfrYYt8BAKqDwK99 SRzQ== X-Received: by 10.70.35.207 with SMTP id k15mr22388798pdj.5.1408909288522; Sun, 24 Aug 2014 12:41:28 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Ian Kelly Date: Sun, 24 Aug 2014 13:40:48 -0600 Subject: Re: Working with decimals To: Python Content-Type: multipart/alternative; boundary=047d7bfe9438a9c9b7050165417c X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 75 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1408909297 news.xs4all.nl 2955 [2001:888:2000:d::a6]:38406 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:76943 --047d7bfe9438a9c9b7050165417c Content-Type: text/plain; charset=UTF-8 On Sun, Aug 24, 2014 at 1:29 PM, Joshua Landau wrote: > > On 24 August 2014 20:25, Joshua Landau wrote: > > On 24 August 2014 20:19, Ian Kelly wrote: > >> On Sun, Aug 24, 2014 at 1:17 PM, Ian Kelly wrote: > >>> On Sun, Aug 24, 2014 at 1:12 PM, Joshua Landau 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 --047d7bfe9438a9c9b7050165417c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Sun, Aug 24, 2014 at 1:29 PM, Joshua Landau <joshua@landau.ws> wrote:
>
>= ; On 24 August 2014 20:25, Joshua Landau <joshua@landau.ws> wrote:
> > On 24 August 2014 20:19, Ian Kelly <ian.g.kelly@gmail.com> wrote:
> >> On Sun= , Aug 24, 2014 at 1:17 PM, Ian Kelly <ian.g.kelly@gmail.com> wrote:
> >>> On Sun, Aug 24, 2014 at 1:12 PM, Joshua Landau <joshua@landau.ws> wrote:
> >&= gt;> > Is math not already imported by start-up?
> >
>= > I don't mean into the global namespace, but imported by other mod= ules
> > (like the builtins) and thus cached, making instantiation trivial= .
>
> Although it doesn't seem to be:
>
> >&= gt;> python -c "import sys; print('math' in sys.modules)&qu= ot;
> False

That's the same check I posted, just using the i= n operator instead of a straight lookup and raising an error.
> An even easier check:
>
> >>> python = -c "import time; a =3D time.time(); import math; b =3D time.time(); pr= int(b-a)"
> 0.0006012916564941406

Too dependent on system timing= s. I get:

$ python -c "import time; a = =3D time.time(); import math; b =3D time.time
(); print(b-a)"= ;
0.0
--047d7bfe9438a9c9b7050165417c--