Index: Doc/library/functions.rst =================================================================== --- Doc/library/functions.rst (revision 84374) +++ Doc/library/functions.rst (working copy) @@ -192,13 +192,21 @@ .. function:: complex([real[, imag]]) Create a complex number with the value *real* + *imag*\*j or convert a string or - number to a complex number. If the first parameter is a string, it will be - interpreted as a complex number and the function must be called without a second - parameter. The second parameter can never be a string. Each argument may be any - numeric type (including complex). If *imag* is omitted, it defaults to zero and - the function serves as a numeric conversion function like :func:`int`, - :func:`long` and :func:`float`. If both arguments are omitted, returns ``0j``. + number to a complex number. + + If the first parameter is a string, it will be interpreted as a complex number + and the function must be called without a second parameter. The string + parameter must not contain any whitespace around the central operator (or + else :exc:`ValueError` will be raised). + ``1+2j`` is fine where ``1 + 2j`` or other variants with whitespace between + the real and imaginary numbers is not. The second parameter can never be a + string. + Each argument may be any numeric type (including complex). If *imag* is + omitted, it defaults to zero and the function serves as a numeric conversion + function like :func:`int`, :func:`long` and :func:`float`. If both arguments + are omitted, returns ``0j``. + The complex type is described in :ref:`typesnumeric`.