summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2024-05-30 20:30:57 (GMT)
committerGitHub <noreply@github.com>2024-05-30 20:30:57 (GMT)
commitef01e95ae3659015c2ebe4ecdc048aadcda89930 (patch)
tree25ad995975f9fc600a9b3c8bb0030435b30fed6c /Doc
parentdeda85717b2557c6bad8b9a51719c60ac510818f (diff)
downloadcpython-ef01e95ae3659015c2ebe4ecdc048aadcda89930.zip
cpython-ef01e95ae3659015c2ebe4ecdc048aadcda89930.tar.gz
cpython-ef01e95ae3659015c2ebe4ecdc048aadcda89930.tar.bz2
gh-109218: Deprecate weird cases in the complex() constructor (GH-119620)
* Passing a string as the "real" keyword argument is now an error; it should only be passed as a single positional argument. * Passing a complex number as the "real" or "imag" argument is now deprecated; it should only be passed as a single positional argument.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/functions.rst4
-rw-r--r--Doc/whatsnew/3.14.rst4
2 files changed, 8 insertions, 0 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index c07b104..7291461 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -449,6 +449,10 @@ are always available. They are listed here in alphabetical order.
Falls back to :meth:`~object.__index__` if :meth:`~object.__complex__` and
:meth:`~object.__float__` are not defined.
+ .. deprecated:: 3.14
+ Passing a complex number as the *real* or *imag* argument is now
+ deprecated; it should only be passed as a single positional argument.
+
.. function:: delattr(object, name)
diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst
index 8c37825..d443cf9 100644
--- a/Doc/whatsnew/3.14.rst
+++ b/Doc/whatsnew/3.14.rst
@@ -103,6 +103,10 @@ Optimizations
Deprecated
==========
+* Passing a complex number as the *real* or *imag* argument in the
+ :func:`complex` constructor is now deprecated; it should only be passed
+ as a single positional argument.
+ (Contributed by Serhiy Storchaka in :gh:`109218`.)
Removed