Cournapeau David <da...@ar.media.kyoto-u.ac.jp> added the comment:

I started a patch against the trunk to handle nan/inf/infinite (I have
not yet tackled the problem of negative zero).

The patch is a bit big, because I found the function quite difficult to
follow, so I refactored it a bit first (replacing the state machine with
the big switch with a sequential parsing). One potential problem is that
I do some computation with inf to make signed infinite, I don't know if
it is safe. I don't know is setting a variable to Nan is safe either.

Although I tested the function in a simple main under valgrind for
various legit and bogus input, there is no tests in this patch. I would
like to add some, but I am not familiar with python testing, so I would
be glad to receive some indications on how to do it properly.

----------
keywords: +patch
nosy: +cdavid
Added file: http://bugs.python.org/file12502/nan_parse.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue2121>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to