[issue9574] complex does not parse strings containing decimals

Mark Dickinson report at bugs.python.org
Thu Aug 12 09:52:26 CEST 2010


Mark Dickinson <dickinsm at gmail.com> added the comment:

The problem here is the spaces in the input string:

newton:~ dickinsm$ python2.7
Python 2.7 (r27:82500, Jul 13 2010, 14:10:05) 
[GCC 4.2.1 (Apple Inc. build 5659)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> complex("1.1+2.1j")
(1.1+2.1j)

The current behaviour is by design, so I'm changing to feature request.  It may make sense to consider allowing whitespace around the central '+' or '-', though this would mildly complicate the parsing.

I'd be +0 on this change.

----------
assignee:  -> mark.dickinson
nosy: +mark.dickinson
type: behavior -> feature request

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9574>
_______________________________________


More information about the Python-bugs-list mailing list