[Python-checkins] cpython (3.2): Closes #9574: Note that complex constructor doesn't allow whitespace around
mark.dickinson
python-checkins at python.org
Sat Mar 10 17:15:40 CET 2012
http://hg.python.org/cpython/rev/a5b073b1cfea
changeset: 75518:a5b073b1cfea
branch: 3.2
parent: 75513:b96251d9f36a
user: Mark Dickinson <mdickinson at enthought.com>
date: Sat Mar 10 16:09:35 2012 +0000
summary:
Closes #9574: Note that complex constructor doesn't allow whitespace around central operator.
files:
Doc/library/functions.rst | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -247,6 +247,13 @@
the function serves as a numeric conversion function like :func:`int`
and :func:`float`. If both arguments are omitted, returns ``0j``.
+ .. note::
+
+ When converting from a string, the string must not contain whitespace
+ around the central ``+`` or ``-`` operator. For example,
+ ``complex('1+2j')`` is fine, but ``complex('1 + 2j')`` raises
+ :exc:`ValueError`.
+
The complex type is described in :ref:`typesnumeric`.
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list