Re: [Python-ideas] Re: Magnitude and ProtoMagnitude ABCs — primarily for argument validation

2020-03-10 Thread Marco Sulla via Python-list
On Tue, 10 Mar 2020 at 13:41, Chris Angelico wrote: > It makes good sense for > division by 0 and division by 0.0 to both result in the same > exception. But Python 3 returns a float, for example, in division between integers. 4 / 2 == 2.0. So some_integer / +0 should return +Infinity. This is

Re: [Python-ideas] Re: Magnitude and ProtoMagnitude ABCs — primarily for argument validation

2020-03-10 Thread Alan Bawden
Chris Angelico writes: > People keep saying this - that nan exists to avoid exceptions - but > that doesn't take signalling nans into account. Even in C, they are > expected to raise an exception or equivalent. Actually, its not that far from the truth to say that NaNs "exist to avoid

Re: [Python-ideas] Re: Magnitude and ProtoMagnitude ABCs — primarily for argument validation

2020-03-10 Thread Chris Angelico
On Tue, Mar 10, 2020 at 11:16 PM Marco Sulla via Python-list wrote: > Raising a NanError seems to me the only way to eliminate the NaN > problem. Indeed NaN was created for languages like C, that does not > support exceptions. People keep saying this - that nan exists to avoid exceptions - but

Re: [Python-ideas] Re: Magnitude and ProtoMagnitude ABCs — primarily for argument validation

2020-03-10 Thread Marco Sulla via Python-list
I think that implementing TotallyOrderable and PartiallyOrderable is a good idea. But is it useful? I mean, I don't know how much people needs really to order sets. Maybe some mathematician. But they can simply use Sage:

Re: [Python-ideas] Re: Magnitude and ProtoMagnitude ABCs — primarily for argument validation

2020-03-10 Thread Tim Peters via Python-list
[Marco Sulla ] > Excuse me, Tim Peters, what do you think about my (probably heretical) > proposal of simply raising an exception instead of return a NaN, like > Python already do for division by zero? Sorry, I'm missing context. I don't see any other message(s) from you in this thread, so don't