Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!rt.uk.eu.org!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'context': 0.07; 'float': 0.07; 'stored': 0.12; '>on': 0.16; 'ah,': 0.16; 'cool.': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; "he'd": 0.16; 'message- id:@cskk.homeip.net': 0.16; 'nans': 0.16; 'objects.': 0.16; 'operator.': 0.16; 'other,': 0.16; 'received:211.29': 0.16; 'received:211.29.132': 0.16; 'received:cskk.homeip.net': 0.16; 'received:homeip.net': 0.16; 'received:optusnet.com.au': 0.16; 'received:syd.optusnet.com.au': 0.16; 'simpson': 0.16; 'subject:alternative': 0.16; 'subject:based': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'cheers,': 0.24; 'possibly': 0.26; 'header:In-Reply-To:1': 0.27; "doesn't": 0.30; 'that.': 0.31; 'decimal': 0.31; 'extending': 0.31; 'option': 0.32; 'implemented': 0.33; 'something': 0.35; 'equal': 0.35; 'received:com.au': 0.36; 'charset:us-ascii': 0.36; 'possible': 0.36; 'too': 0.37; 'performance': 0.37; 'manager': 0.38; 'received:211': 0.38; 'needed': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'new': 0.61; 'content- disposition:inline': 0.62; '9.4.3': 0.84; 'ethan': 0.84; 'float,': 0.84; 'furman': 0.84; 'subject:Proposal': 0.91 Date: Sat, 12 Jul 2014 08:42:44 +1000 From: Cameron Simpson To: python-list@python.org Subject: Re: context manager based alternative to Re: Proposal: === and !=== MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <53BF3109.4070604@stoneleaf.us> User-Agent: Mutt/1.5.21 (2010-09-15) References: <53BF3109.4070604@stoneleaf.us> X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=dZS5gxne c=1 sm=1 tr=0 a=YuQlxtEQCowy2cfE5kc7TA==:117 a=YuQlxtEQCowy2cfE5kc7TA==:17 a=ZtCCktOnAAAA:8 a=PO7r1zJSAAAA:8 a=LcaDllckn3IA:10 a=cmIrFrC7TMAA:10 a=kj9zAlcOel0A:10 a=vrnE16BAAAAA:8 a=P-A63Mvt3U8mif0dQKIA:9 a=CjuIK1q_8ugA:10 a=ExiFL-q3zkAA:10 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1405118573 news.xs4all.nl 2926 [2001:888:2000:d::a6]:59508 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:74363 On 10Jul2014 17:34, Ethan Furman wrote: >On 07/10/2014 05:20 PM, Cameron Simpson wrote: >>Here's an alternative proposal that doesn't involve a new operator. >[snip float-context manager stuff] > >Decimal has a context manager like that already (I don't know if it >supports allowing NaNs to equal each other, though). Interesting. I did not know that. [...] Ah, 9.4.3 Context Objects. Cool. >Rather than adding the whole thing to float, perhaps extending Decimal's >context with that option is a possible route. The OP needed to work with floats. The data storage systems he was using stored IEEE floats IIRC, so Decimal may not be suitable and possibly has performance effects too - dunno. I would think he'd need something implemented in the float type. Cheers, Cameron Simpson Nothing is impossible for the man who doesn't have to do it.