Message231724
The help page for the built-in repr() states ''' For many types, this function makes an attempt to return a string that would yield an object with the same value when passed to eval()...'''
This holds true for non-inf/nan values of float():
>>> eval(repr(float('0.0')))
0.0
But for inf, -inf, and nan it does not:
>>> eval(repr(float('inf')))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 1, in <module>
NameError: name 'inf' is not defined
Expected return from repr(float('inf')) was "float('inf')", but perhaps 'inf' response has too much history at this point to be changed. |
|
Date |
User |
Action |
Args |
2014-11-26 19:47:16 | jaebae17 | set | recipients:
+ jaebae17 |
2014-11-26 19:47:16 | jaebae17 | set | messageid: <1417031236.3.0.00389201998154.issue22951@psf.upfronthosting.co.za> |
2014-11-26 19:47:16 | jaebae17 | link | issue22951 messages |
2014-11-26 19:47:16 | jaebae17 | create | |
|