Improve `unicodedata.numeric` return value
Open
Nobody has claimed this yet.
stdlib
topic-unicode
type-feature
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Bug report
Bug description:
As 1/20 != 3602879701896397/72057594037927936. Maybe add a Fraction function to the unicodedata object?
import unicodedata
from fractions import Fraction
c = '൛'
str(Fraction(unicodedata.numeric(c)))
CPython versions tested on:
3.11
Operating systems tested on:
Linux
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 by reproducing the provided Python snippet at the unicodedata.numeric entry point and compare its result with Fraction. No source file or test is named in the issue; before implementation, clarify whether the desired outcome is a Fraction-based API or another exact representation, then define regression coverage and the expected result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100