gh-155966: Correct handling of `math.tanpi` poles by jepler · Pull Request #155980 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions Lib/test/mathdata/math_testcases.txt
5 changes: 5 additions & 0 deletions Lib/test/test_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -2144,7 +2144,12 @@ def test_mtestfile(self):
fail_fmt = "{}: {}{!r}: {}"

failures = []
ids = set()
for id, fn, args, expected, flags in parse_mtestfile(math_testcases):
if id in ids:
failures.append(f"Duplicate test id {id}")
ids.add(id)

func = getattr(math, fn)

if 'invalid' in flags or 'divide-by-zero' in flags:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:func:`math.tanpi` now raises :exc:`ValueError` for half-integer values
(e.g., ``tanpi(1.5)``), as these are poles of the function.
4 changes: 2 additions & 2 deletions Modules/mathmodule.c
Loading