New submission from Mark Dickinson <dicki...@gmail.com>: Here's a patch that:
1. greatly simplifies the complex parsing code in Objects/complexobject.c 2. allows nans and infinities in constructing a complex number from a string 3. fixes missing out-of-memory checks (PyOS_ascii_strtod can fail due to lack of memory). Note that part 2. comes entirely for free with the parsing simplification. But it seems to me that if float('inf') is valid, then complex('inf') should be valid too. There are potential uses for being able to create a complex infinity when working with the complex projective plane (a natural domain for rational functions over the complex numbers). ---------- files: simplify_complex_parsing.patch keywords: patch messages: 86328 nosy: marketdickinson severity: normal status: open title: Simplify parsing of complex numbers and make complex('inf') valid. Added file: http://bugs.python.org/file13738/simplify_complex_parsing.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5816> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com