]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-84978: Add float.from_number() and complex.from_number() (GH-26827)
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 15 Jul 2024 16:07:00 +0000 (19:07 +0300)
committerGitHub <noreply@github.com>
Mon, 15 Jul 2024 16:07:00 +0000 (16:07 +0000)
commit94bee45dee41876e88fe023b9163178d376355dc
treeedbd2ba0cf02984c04d7691fbdb54857652d0840
parent8303d32ff55945c5b38eeeaf1b1811dbcf8aa9be
gh-84978: Add float.from_number() and complex.from_number() (GH-26827)

They are alternate constructors which only accept numbers
(including objects with special methods __float__, __complex__
and __index__), but not strings.
Doc/library/functions.rst
Doc/library/stdtypes.rst
Doc/whatsnew/3.14.rst
Lib/test/test_complex.py
Lib/test/test_float.py
Misc/NEWS.d/next/Core and Builtins/2023-10-14-23-05-40.gh-issue-84978.Z0t6dg.rst [new file with mode: 0644]
Objects/clinic/complexobject.c.h
Objects/clinic/floatobject.c.h
Objects/complexobject.c
Objects/floatobject.c