Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #76941

Re: Working with decimals

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!weretis.net!feeder4.news.weretis.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <joshua.landau.ws@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.020
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'imported': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; '24,': 0.16; 'be:': 0.16; 'math,': 0.16; 'namespace,': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; '>>>': 0.22; 'import': 0.22; 'aug': 0.22; 'cc:addr:python.org': 0.22; 'math': 0.24; 'cc:2**0': 0.24; 'header :In-Reply-To:1': 0.27; 'thus': 0.29; "doesn't": 0.30; '(like': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'easier': 0.31; 'time;': 0.31; 'guess': 0.33; 'subject:with': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'false': 0.36; 'so,': 0.37; 'pm,': 0.38; 'even': 0.60; 'ian': 0.60; 'august': 0.61; 'making': 0.63; 'to:addr:gmail.com': 0.65
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=zxTlBPsunnlhXhnBZ9TW+6cmGwME3ZbOC0Mv3oqkJGA=; b=pYYI13prnYWfrWTMdF1fXqCocikPA9f/PGcB1GKcFeFe6gNTYCWniZk1T3anwaM1dB isS5kBejg9UGOrZkjIPurwFVfsLuki1XFJuKaBtevmQ0X+QxMjQeyoNvbJOWBgzw38Z0 FvBH3Vwn0UVzLc+e3knKrWYweHgHI4moo8Ig29+g93u7pPkqRw8tpR0drsm7gw8QTowZ FCnGelSVgnlUXxgzLNIVCL++aDEAuDIOWN7ts62+XZkXvgdTj/xvfw9rlXWDMcgJnkGx U15ywTPY9tJN4UsmNPq8V/JoROiXWcsC/UWoWmTaZmxIUZ5wVnpbByepwl+TU/+s9i+V jp+w==
X-Received by 10.152.207.99 with SMTP id lv3mr17054255lac.22.1408908598553; Sun, 24 Aug 2014 12:29:58 -0700 (PDT)
MIME-Version 1.0
Sender joshua.landau.ws@gmail.com
In-Reply-To <CAN1F8qVZ9BqC2dkN2iLXxGbcC0goHWVwwU=d9d+rQpDZJ3GX4A@mail.gmail.com>
References <vrihv9l5sce3bkreceav5uhkaqdo9dqnri@4ax.com> <ek0iv9diq2io1126te9j5pppoilstfuvdo@4ax.com> <CAN1F8qXtRbPiQ_W93iFLcaxT40B2uoeg_aZ8aYYhQvP7FCShqQ@mail.gmail.com> <CAPTjJmq26CwkwWE_32_C9CKXFsfnE1bb-jwW7dE2HkZ6EyW40Q@mail.gmail.com> <CAN1F8qUnUWk06uBXe0D-0V1HBuhM7j_Pxcqgb4y61kvh7ioygA@mail.gmail.com> <CAPTjJmpRwPj2huRNAFWzbCPT5PAJga6ORC96PKo2EQ7hedozOg@mail.gmail.com> <CAN1F8qV3VjrzQc3Ogbjgwm4WzMBbtR0SwNQPJ-kifU5rVNb7cw@mail.gmail.com> <CALwzid=LGedZw6uy6kgm07i5jB2GogepmnahSWf8QRxFfmFxBA@mail.gmail.com> <CALwzidkSMA-u-jL6jXjv7C7vRo-=QqAd72WPfBQzG2ghYSYhKA@mail.gmail.com> <CAN1F8qVZ9BqC2dkN2iLXxGbcC0goHWVwwU=d9d+rQpDZJ3GX4A@mail.gmail.com>
From Joshua Landau <joshua@landau.ws>
Date Sun, 24 Aug 2014 20:29:18 +0100
X-Google-Sender-Auth QlK-jrqW5RvSL2DogFWXAYlnrz8
Subject Re: Working with decimals
To Ian Kelly <ian.g.kelly@gmail.com>
Content-Type text/plain; charset=UTF-8
Cc Python <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.13385.1408908600.18130.python-list@python.org> (permalink)
Lines 24
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1408908600 news.xs4all.nl 2927 [2001:888:2000:d::a6]:59462
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:76941

Show key headers only | View raw


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:
>>> > 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

An even easier check:

>>> python -c "import time; a = time.time(); import math; b = time.time(); print(b-a)"
0.0006012916564941406

>>> python -c "import math, time; a = time.time(); import math; b = time.time(); print(b-a)"
9.5367431640625e-06

I guess I'm just pessimistic. Even so, that's not much reason to hide
the import inside a function.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Working with decimals Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-08-23 13:47 -0400
  Re: Working with decimals Joel Goldstick <joel.goldstick@gmail.com> - 2014-08-23 14:21 -0400
    Re: Working with decimals Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-08-23 15:07 -0400
      Re: Working with decimals Joel Goldstick <joel.goldstick@gmail.com> - 2014-08-23 15:22 -0400
      Re: Working with decimals Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-23 20:24 +0100
        Re: Working with decimals Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-08-23 15:48 -0400
          Re: Working with decimals Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-23 21:31 +0100
  Re: Working with decimals Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-08-23 17:13 -0400
    Re: Working with decimals Joshua Landau <joshua@landau.ws> - 2014-08-23 22:47 +0100
    Re: Working with decimals Chris Angelico <rosuav@gmail.com> - 2014-08-24 08:31 +1000
    Re: Working with decimals Joshua Landau <joshua@landau.ws> - 2014-08-23 23:47 +0100
    Re: Working with decimals Chris Angelico <rosuav@gmail.com> - 2014-08-24 08:53 +1000
    Re: Working with decimals Larry Hudson <orgnut@yahoo.com> - 2014-08-24 00:04 -0700
      Re: Working with decimals Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-08-24 10:58 -0400
      Re: Working with decimals Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-08-24 11:12 -0400
        Re: Working with decimals Larry Hudson <orgnut@yahoo.com> - 2014-08-24 14:24 -0700
          Re: Working with decimals Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-08-24 19:07 -0400
    Re: Working with decimals Joshua Landau <joshua@landau.ws> - 2014-08-24 20:12 +0100
    Re: Working with decimals Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-24 13:17 -0600
    Re: Working with decimals Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-24 13:19 -0600
    Re: Working with decimals Joshua Landau <joshua@landau.ws> - 2014-08-24 20:25 +0100
    Re: Working with decimals Joshua Landau <joshua@landau.ws> - 2014-08-24 20:29 +0100
      Re: Working with decimals Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-25 12:16 +1000
        Re: Working with decimals Chris Angelico <rosuav@gmail.com> - 2014-08-25 12:27 +1000
          Re: Working with decimals Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-25 12:51 +1000
            Re: Working with decimals Chris Angelico <rosuav@gmail.com> - 2014-08-25 13:01 +1000
    Re: Working with decimals Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-24 13:37 -0600
    Re: Working with decimals Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-24 13:40 -0600
    Re: Working with decimals Joshua Landau <joshua@landau.ws> - 2014-08-24 20:49 +0100
  Re: Working with decimals Joshua Landau <joshua@landau.ws> - 2014-08-23 22:52 +0100
    Re: Working with decimals Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-08-23 18:03 -0400

csiph-web