Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.tele.dk!feed118.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: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.082 X-Spam-Evidence: '*H*': 0.85; '*S*': 0.01; 'shame': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; '-tkc': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'skip:d 120': 0.16; 'language': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply- To:1': 0.27; 'changed.': 0.31; 'constant': 0.31; 'maybe': 0.34; 'johnson': 0.35; 'but': 0.35; 'really': 0.36; 'charset:us-ascii': 0.36; 'should': 0.36; 'being': 0.38; 'how': 0.40; 'back': 0.62; 'real': 0.63; 'places': 0.64; 'to:addr:gmail.com': 0.65; '2-3': 0.68; 'received:50.22': 0.84; 'numbers:': 0.91; 'subject:Global': 0.91; 'rick': 0.93 Date: Tue, 12 Nov 2013 21:22:12 -0600 From: Tim Chase To: Rick Johnson Subject: Re: PyMyth: Global variables are evil... WRONG! In-Reply-To: References: <7b97786a-2aaf-454c-8c3a-1c19d20d4345@googlegroups.com> <4bef88d0-d3eb-42e5-ac8e-288c629c528e@googlegroups.com> <2a325d8a-a242-4f2a-861b-9b786600f886@googlegroups.com> <5234e28a-8d7f-4a84-a1de-c5144fa869e6@googlegroups.com> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com X-Get-Message-Sender-Via: boston.accountservergroup.com: authenticated_id: tim@thechases.com Cc: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1384312844 news.xs4all.nl 15942 [2001:888:2000:d::a6]:56615 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:59280 On 2013-11-12 18:45, Rick Johnson wrote: > "math.pi" should be "math.PI". It's a real shame that this fails: >>> math.PI = math.pi oh...wait... > and PI should be a CONSTANT. And not just a pseudo constant, but a > REAL constant that cannot be changed. How much precision do you want? Perhaps you really do want do just use because you know you only have 2-3 places of precision in your other numbers: math.pi = 3.14 Or maybe you want to monkey-patch in a fraction/decimal instead for greater precision: math.pi = decimal.Decimal('3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679') It comes back to Python being a language for consenting adults. -tkc