summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMark Dickinson <mdickinson@enthought.com>2012-03-10 16:09:35 (GMT)
committerMark Dickinson <mdickinson@enthought.com>2012-03-10 16:09:35 (GMT)
commit328dd0d5f3d20c01d85675f6e5d1001dd2a04480 (patch)
treeb76913353af79ee8e75503da57cfafddab9aef15 /Doc
parente144c74e023b9caccd0a23ff718028cdd376cddd (diff)
downloadcpython-328dd0d5f3d20c01d85675f6e5d1001dd2a04480.zip
cpython-328dd0d5f3d20c01d85675f6e5d1001dd2a04480.tar.gz
cpython-328dd0d5f3d20c01d85675f6e5d1001dd2a04480.tar.bz2
Closes #9574: Note that complex constructor doesn't allow whitespace around central operator.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/functions.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index f835dcf..3fcd694 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -247,6 +247,13 @@ are always available. They are listed here in alphabetical order.
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`.