]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-121798: Add class method Decimal.from_number() (GH-121801)
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 14 Oct 2024 08:24:01 +0000 (11:24 +0300)
committerGitHub <noreply@github.com>
Mon, 14 Oct 2024 08:24:01 +0000 (08:24 +0000)
commit5217328f93f599755bd70418952392c54f705a71
tree87e238d2b2cdd326b396db73e582c535ef623836
parent4b358ee647809019813f106eb901f466a3846d98
gh-121798: Add class method Decimal.from_number() (GH-121801)

It is an alternate constructor which only accepts a single numeric argument.
Unlike to Decimal.from_float() it accepts also Decimal.
Unlike to the standard constructor, it does not accept strings and tuples.
Doc/library/decimal.rst
Doc/whatsnew/3.14.rst
Lib/_pydecimal.py
Lib/test/test_decimal.py
Misc/NEWS.d/next/Library/2024-07-15-19-25-25.gh-issue-121798.GmuBDu.rst [new file with mode: 0644]
Modules/_decimal/_decimal.c
Modules/_decimal/docstrings.h