diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2024-05-30 20:30:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-30 20:30:57 (GMT) |
commit | ef01e95ae3659015c2ebe4ecdc048aadcda89930 (patch) | |
tree | 25ad995975f9fc600a9b3c8bb0030435b30fed6c /Doc | |
parent | deda85717b2557c6bad8b9a51719c60ac510818f (diff) | |
download | cpython-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.rst | 4 | ||||
-rw-r--r-- | Doc/whatsnew/3.14.rst | 4 |
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 |