A funnily inconsistent behavior of int and float
Colin J. Williams
fn681 at ncf.ca
Mon Apr 7 06:43:40 EDT 2008
Mark Dickinson wrote:
> On Apr 6, 1:29 pm, Lie <Lie.1... at gmail.com> wrote:
>> I've noticed some oddly inconsistent behavior with int and float:
>>
>> Python 2.5.1 (r251:54863, Mar 7 2008, 03:39:23)
>> [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2>>> int('- 345')
>>
>> -345
>>
>> works, but
>>
>>>>> float('- 345.083')
>> Traceback (most recent call last):
>> File "<stdin>", line 1, in <module>
>> ValueError: invalid literal for float(): - 345.083
>
> This is a known issue, that has been fixed for Python 3.0.
> It was decided not to risk breakage by changing this in
> Python 2.x. See:
>
> http://bugs.python.org/issue1779
>
> Mark
This is good but the documentation for
3.0 is missing the syntax documentation
from 2.5
Colin W.
More information about the Python-list
mailing list