[Python-ideas] float('∞')=float('inf')
Serhiy Storchaka
storchaka at gmail.com
Fri Jul 12 23:46:11 CEST 2013
13.07.13 00:27, Joshua Landau написав(ла):
> On 12 July 2013 18:58, Serhiy Storchaka <storchaka at gmail.com
> <mailto:storchaka at gmail.com>> wrote:
> I agree. But how is it related to ½ and 3.(142857)?
> ½ === 1/2; thus is an expression
0.5 === 5/10. Isn't it an expression?
> 3.(142857) is more ambiguous, because there's not actually any
> mathematical operator in place. But it is too much parsing for no
> benefit, AFAICT; you would complicate something simple to solve almost
> no use-cases, and then when they are used it's harder for people to work
> out what is meant.
AFAIK children teach 3.(142857) before ∞. I'm sure people use fractions
and recurring decimals more often than infinity.
> The informal definition for "expression" with regards
> to int and float I'm using is basically the measure of how much more
> parsing code would need to be implemented.
½ requires no more parsing code then ∞.
More information about the Python-ideas
mailing list