From: Mark Dickinson Date: Sat, 10 Mar 2012 16:09:35 +0000 (+0000) Subject: Closes #9574: Note that complex constructor doesn't allow whitespace around central... X-Git-Tag: v2.7.4rc1~981 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5081957642caffae192b6e3f045a92b55afc8e9c;p=python Closes #9574: Note that complex constructor doesn't allow whitespace around central operator. --- 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`.