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

Serhiy Storchaka storchaka at gmail.com
Fri Jul 12 19:12:13 CEST 2013


12.07.13 18:50, Joshua Landau написав(ла):
> On 12 July 2013 16:26, Serhiy Storchaka <storchaka at gmail.com> wrote:
>> 12.07.13 17:10, Joshua Landau написав(ла):
>>
>>> int and float are obviously meant to handle abstract inputs (not
>>> expressions) and unicode infinity is an extension of this. Your
>>> "analogies" are inapt.
>>
>>
>> Why you think ½ (this is only one symbol!) and 3.(142857) (this is a decimal
>> notation of the 22/7 fraction) are expressions, but ∞ or even -1 are not?
>
> For the same reason that 0.5 and [0,
> 1, 2, 3, 4] are literals but 1/2 and range(5) are not.

∞ is not a literal.




More information about the Python-ideas mailing list