mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
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.
This commit is contained in:
parent
deda85717b
commit
ef01e95ae3
6 changed files with 164 additions and 61 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue