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


Groups > comp.lang.python > #76952

Re: Working with decimals

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
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; 'python,': 0.02; 'importing': 0.05; 'cheshire': 0.09; 'statements': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; "wouldn't": 0.14; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'imports': 0.16; 'math,': 0.16; 'measurement': 0.16; 'statements,': 0.16; 'followed': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'normally': 0.19; 'import': 0.22; 'aug': 0.22; 'cc:addr:python.org': 0.22; 'mon,': 0.24; 'file.': 0.24; 'cc:2**0': 0.24; 'right.': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'easier': 0.31; '25,': 0.31; 'comparison': 0.31; "d'aprano": 0.31; 'decimal': 0.31; 'steven': 0.31; 'time;': 0.31; "we're": 0.32; 'subject:with': 0.35; 'agree': 0.35; 'received:google.com': 0.35; 'are,': 0.36; 'false': 0.36; 'two': 0.37; 'list.': 0.37; 'pm,': 0.38; 'visual': 0.39; 'even': 0.60; 'simply': 0.61; 'love': 0.65; 'here': 0.66; 'benefit': 0.68; 'containing': 0.69; 'here!': 0.84; 'ridiculously': 0.84; 'to:none': 0.92; 'hoist': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=Dqt6HAl+lVm5RuZ5XGVgR0+xmRVO8tUdhVEpPEUSwKo=; b=yLq6+7XI3L0z07psZZBRfTpR+rZSUWagh8H7igpqW2zIWJMrXkzG6KFEiSgVlwRYF8 lGrNnStEjqG8wCz/Tjj9ymDZSuUmfgQLs9cfnVXB1wEzirtISkkRTgJeW0Rf7cDgugiM 7yaw31QTcr2QK7QAy2DW1RZffJmRdu6w438EGpiH2QR5BjIXWDo0TDf9wSawb6kEqj2H x/BHDGQsRlq9am6awj3Qwjv93BZky3RYTGu8OM6JyyHfdl1yW4GouHBL9a9BqYFncUJF ig7H3GmYzWWqX1EeDOozV1pxgPD80t8oKzCG79IqFdvYcnbCUu0LfmKK3UMHjNopF9WL 4xBQ==
MIME-Version 1.0
X-Received by 10.42.216.135 with SMTP id hi7mr21336730icb.12.1408933638698; Sun, 24 Aug 2014 19:27:18 -0700 (PDT)
In-Reply-To <53fa9c7b$0$29967$c3e8da3$5496439d@news.astraweb.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> <mailman.13385.1408908600.18130.python-list@python.org> <53fa9c7b$0$29967$c3e8da3$5496439d@news.astraweb.com>
Date Mon, 25 Aug 2014 12:27:18 +1000
Subject Re: Working with decimals
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
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.13392.1408933645.18130.python-list@python.org> (permalink)
Lines 33
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1408933645 news.xs4all.nl 2959 [2001:888:2000:d::a6]:54941
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:76952

Show key headers only | View raw


On Mon, Aug 25, 2014 at 12:16 PM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> Joshua Landau wrote:
>
>
>>>>> 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 wouldn't exactly say that *two* calls to Python, each containing *five*
> statements, followed by a visual comparison of two decimal numbers,
> is "even easier" than a single call to Python, containing just two
> statements :-)

I love this list. We can go off on a ridiculously long tangent, simply
because I said that it's only *usually* best to put imports at the top
of the file. We all agree that it normally is indeed best to hoist
them, and here we are, arguing over measurement methods on whether or
not there's ever any benefit to importing inside a function.

Yep, the Cheshire Cat was right. We're all mad here!

ChrisA

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