[issue5816] Simplify parsing of complex numbers and make complex('inf') valid.
report at bugs.python.org
Wed Apr 22 22:27:20 CEST 2009
New submission from Mark Dickinson <dickinsm at 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
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).
title: Simplify parsing of complex numbers and make complex('inf') valid.
Added file: http://bugs.python.org/file13738/simplify_complex_parsing.patch
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list