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


Groups > comp.lang.python > #66409

Re: decimal numbers

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; '"""': 0.07; 'lines,': 0.07; 'python3': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'wrote': 0.14; '__future__': 0.16; 'directive': 0.16; 'docstring': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reproduce': 0.16; 'script?': 0.16; 'module': 0.19; '>>>': 0.22; 'import': 0.22; 'script.': 0.24; 'skip:n 60': 0.24; 'header:X-Complaints-To:1': 0.27; 'appear': 0.29; 'statement': 0.30; 'lines': 0.31; 'comments,': 0.31; 'division': 0.31; 'subject:numbers': 0.31; 'are:': 0.33; 'received:co.za': 0.34; 'received:za': 0.34; 'add': 0.35; 'module.': 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'future': 0.60; 'blank': 0.60; 'new': 0.61; 'frank': 0.68; 'received:41': 0.70
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From "Frank Millman" <frank@chagford.com>
Subject Re: decimal numbers
Date Sat, 15 Feb 2014 12:56:25 +0200
References <833583c7-c307-4ebf-9a60-3be146a565b5@googlegroups.com> <ec88852e-1384-4aa5-834b-85135be94ab9@googlegroups.com> <mailman.6976.1392458669.18130.python-list@python.org> <ae0da085-6c41-4166-92d2-92611a990885@googlegroups.com> <ldngnf$c3r$1@ger.gmane.org>
X-Gmane-NNTP-Posting-Host 41-133-114-46.dsl.mweb.co.za
X-MSMail-Priority Normal
X-Newsreader Microsoft Outlook Express 6.00.3790.4657
X-RFC2646 Format=Flowed; Response
X-MimeOLE Produced By Microsoft MimeOLE V6.00.3790.4913
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.6979.1392461797.18130.python-list@python.org> (permalink)
Lines 46
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1392461797 news.xs4all.nl 2882 [2001:888:2000:d::a6]:35278
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:66409

Show key headers only | View raw


"Frank Millman" <frank@chagford.com> wrote in message 
news:ldngnf$c3r$1@ger.gmane.org...
>
> "Luke Geelen" <luke.geelen@gmail.com> wrote in message 
> news:ae0da085-6c41-4166-92d2-92611a990885@googlegroups.com...
>> Op zaterdag 15 februari 2014 11:04:17 UTC+1 schreef Frank Millman:
>>> "Luke Geelen" <luke.geelen@gmail.com> wrote in message
>>>
>>> news:ec88852e-1384-4aa5-834b-85135be94ab9@googlegroups.com...
>>>
> [...]
>>>
>>> You can reproduce the python3 behaviour in python2 by adding a 'future' 
>>> directive -
>>>
>>> >>> from __future__ import division
>>>
>>> >>> 10/3
>>>
>>> 3.3333333333333335
>>>
>>
>> how (and where) would i add this rule into a script? by import or the 
>> calculation?
>
> Treat it like any other import - add it as a new line at the top of your 
> script.
>

Actually I did not answer that very accurately. From the documentation -

"""
A future statement must appear near the top of the module. The only lines 
that can appear before a future statement are:

    the module docstring (if any),
    comments,
    blank lines, and
    other future statements.
"""

Frank


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


Thread

decimal numbers luke.geelen@gmail.com - 2014-02-15 01:18 -0800
  Re: decimal numbers Luke Geelen <luke.geelen@gmail.com> - 2014-02-15 01:19 -0800
    Re: decimal numbers "Frank Millman" <frank@chagford.com> - 2014-02-15 12:04 +0200
      Re: decimal numbers Luke Geelen <luke.geelen@gmail.com> - 2014-02-15 02:32 -0800
        Re: decimal numbers "Frank Millman" <frank@chagford.com> - 2014-02-15 12:49 +0200
          Re: decimal numbers Luke Geelen <luke.geelen@gmail.com> - 2014-02-15 09:17 -0800
            Re: decimal numbers Ian Kelly <ian.g.kelly@gmail.com> - 2014-02-15 10:23 -0700
              Re: decimal numbers Luke Geelen <luke.geelen@gmail.com> - 2014-02-15 09:42 -0800
                Re: decimal numbers Luke Geelen <luke.geelen@gmail.com> - 2014-02-15 10:57 -0800
                Re: decimal numbers Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-15 19:06 +0000
                Re: decimal numbers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-02-15 19:43 +0000
                Re: decimal numbers Ian Kelly <ian.g.kelly@gmail.com> - 2014-02-15 14:34 -0700
                Re: decimal numbers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-02-16 02:30 +0000
                Re: decimal numbers Chris Angelico <rosuav@gmail.com> - 2014-02-16 13:36 +1100
        Re: decimal numbers "Frank Millman" <frank@chagford.com> - 2014-02-15 12:56 +0200
    Re: decimal numbers Chris Angelico <rosuav@gmail.com> - 2014-02-15 21:13 +1100
  Re: decimal numbers Laurent Pointal <laurent.pointal@free.fr> - 2014-02-15 15:52 +0100
  Re: decimal numbers Ian Kelly <ian.g.kelly@gmail.com> - 2014-02-15 10:20 -0700
  Re: decimal numbers wxjmfauth@gmail.com - 2014-02-16 04:19 -0800

csiph-web