summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Dickinson <mdickinson@enthought.com>2012-03-10 16:09:35 +0000
committerMark Dickinson <mdickinson@enthought.com>2012-03-10 16:09:35 +0000
commit5081957642caffae192b6e3f045a92b55afc8e9c (patch)
treea05958c815ae42dfae4898159d2b0130809d9a2f
parente107ab3b6cafd5e541ad16fd81eb89d922170162 (diff)
downloadcpython-git-5081957642caffae192b6e3f045a92b55afc8e9c.tar.gz
Closes #9574: Note that complex constructor doesn't allow whitespace around central operator.
-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 5f7bf4d276..f9e5e1be5b 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -247,6 +247,13 @@ available. They are listed here in alphabetical order.
the function serves as a numeric conversion function like :func:`int`,
:func:`long` 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`.