Skip to content

Commit 4a7a33e

Browse files
committed
Closes #9574: Note that complex constructor doesn't allow whitespace around central operator.
1 parent 0944249 commit 4a7a33e

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Doc/library/functions.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,13 @@ available. They are listed here in alphabetical order.
247247
the function serves as a numeric conversion function like :func:`int`,
248248
:func:`long` and :func:`float`. If both arguments are omitted, returns ``0j``.
249249

250+
.. note::
251+
252+
When converting from a string, the string must not contain whitespace
253+
around the central ``+`` or ``-`` operator. For example,
254+
``complex('1+2j')`` is fine, but ``complex('1 + 2j')`` raises
255+
:exc:`ValueError`.
256+
250257
The complex type is described in :ref:`typesnumeric`.
251258

252259

0 commit comments

Comments
 (0)