[Python-ideas] float('∞')=float('inf')

Serhiy Storchaka storchaka at gmail.com
Sun Jul 14 12:11:21 CEST 2013


14.07.13 11:56, Joshua Landau написав(ла):
> On 14 July 2013 09:40, Serhiy Storchaka <storchaka at gmail.com> wrote:
>> 13.07.13 00:55, Joshua Landau wrote:
>>> On 12 July 2013 22:46, Serhiy Storchaka wrote:
>>>> 13.07.13 00:27, Joshua Landau wrote:
>>>>>
>>>>> ½ === 1/2; thus is an expression
>>>>
>>>> 0.5 === 5/10. Isn't it an expression?
>>>
>>> No. That's like saying "1 === 2/2". There is a much more obvious
>>> equivalence between two ways of writing "1/2" than between two ways of
>>> displaying the result of "1/2".
>>
>> 0.5 is 5/10 by definition. The result of 1/2 is a fraction ½.
>
> I don't understand. What are you trying to say?

0.5 is a spelling of 5⁄10 which is a result of expression 5/10. ½ is a 
spelling of 1⁄2 which is a result of expression 1/2. I don't understand 
why you think 1⁄2 is expression while 5⁄10 is not.

>>> Plus, why on earth would you use recurrence for floats? Give me a use
>>> case. There's a good reason for float infinity.
>>
>> This is only a way to spell a general fraction in decimal. On other hand, ∞
>> is even not a real number.
>
> That's not a use-case.

∞ is not a use-case.

>> If you accept ∞ you are bound by law to accept ½ and all of the other
>> fractions — and that's much more code than just allowing ∞.
>
> I was afraid that people would go and take this too literally. But
> either way, if you accept ½ and reject ¾, you have made a really bad
> design decision. If you accept ∞ and reject ½, the atrocity of that
> decision is much less. I would say it's a good choice, you may say it
> is bad. But if you say those are equivalently bad decisions you're
> simply wrong and there's not much more I can say.

The difference between this two bad choices is far less than the 
difference between good and bad. Why should we choose between two bad 
designs?



More information about the Python-ideas mailing list