Increase test coverage for isclose() function with edge cases for special complex numbers
Open
Nobody has claimed this yet.
tests
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
In Lib/test/test_cmath.py, the isclose() function misses certain test cases for special complex numbers with infinity and Nan. As docs tell:
-inf, inf and NaN behave similarly to the IEEE 754 Standard.
That is, NaN is not close to anything, even itself.
inf and -inf are only close to themselves.
This applies for complex numbers as well (inf + infj , -inf - infj and NaN + NaNj behave in the same way).
Linked PRs
- gh-149923
- gh-149948
- gh-150938
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in Lib/test/test_cmath.py and inspect the existing isclose() tests and the documented behavior for infinity, negative infinity, and NaN. Add coverage for the stated special complex-number cases, then run the cmath test file to confirm the expected results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100