]> granicus.if.org Git - python/commitdiff
Closes #9574: Note that complex constructor doesn't allow whitespace around central...
authorMark Dickinson <mdickinson@enthought.com>
Sat, 10 Mar 2012 16:09:35 +0000 (16:09 +0000)
committerMark Dickinson <mdickinson@enthought.com>
Sat, 10 Mar 2012 16:09:35 +0000 (16:09 +0000)
Doc/library/functions.rst

index f835dcfc712380407acdc94733ffee1fbb417e03..3fcd6941c21ea1e8ca1e72da1a22706156927fe6 100644 (file)
@@ -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`.