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


Groups > comp.lang.python > #74363

Re: context manager based alternative to Re: Proposal: === and !===

Date 2014-07-12 08:42 +1000
From Cameron Simpson <cs@zip.com.au>
Subject Re: context manager based alternative to Re: Proposal: === and !===
References <53BF3109.4070604@stoneleaf.us>
Newsgroups comp.lang.python
Message-ID <mailman.11765.1405118573.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 10Jul2014 17:34, Ethan Furman <ethan@stoneleaf.us> 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 <cs@zip.com.au>

Nothing is impossible for the man who doesn't have to do it.

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


Thread

Re: context manager based alternative to Re: Proposal: === and !=== Cameron Simpson <cs@zip.com.au> - 2014-07-12 08:42 +1000

csiph-web