]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-101410: support custom messages for domain errors in the math module (#124299)
authorSergey B Kirpichev <skirpichev@gmail.com>
Thu, 23 Jan 2025 13:55:25 +0000 (16:55 +0300)
committerGitHub <noreply@github.com>
Thu, 23 Jan 2025 13:55:25 +0000 (13:55 +0000)
commit75f59bb62938fc9acac7a4ede19404e889417c6b
treedd6a3a21ab8324df9d49d7c871b8bea5b9d3571e
parent25a614a502e607a333f7aa7f4d69e6f2a47148ad
gh-101410: support custom messages for domain errors in the math module (#124299)

This adds basic support to override default messages for domain errors
in the math_1() helper.  The sqrt(), atanh(), log2(), log10() and log()
functions were modified as examples.  New macro supports gradual
changing of error messages in other 1-arg functions.

Co-authored-by: CharlieZhao <zhaoyu_hit@qq.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Lib/test/test_math.py
Misc/NEWS.d/next/Library/2023-02-01-16-41-31.gh-issue-101410.Dt2aQE.rst [new file with mode: 0644]
Modules/mathmodule.c