-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-136169: Update parameter name in fractions.from_float method #136172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
…pythonGH-136172) Update parameter name in fractions.from_float method (cherry picked from commit 9c0cb5b) Co-authored-by: Vladyslav Lazoryk <[email protected]>
GH-136174 is a backport of this pull request to the 3.14 branch. |
…pythonGH-136172) Update parameter name in fractions.from_float method (cherry picked from commit 9c0cb5b) Co-authored-by: Vladyslav Lazoryk <[email protected]>
GH-136175 is a backport of this pull request to the 3.13 branch. |
If anyone is interested in a follow-up, |
C extension method - doesn't, but for pure-Python case - does: >>> import inspect, _pydecimal, _decimal
>>> inspect.signature(_pydecimal.Decimal.from_float)
<Signature (f)>
>>> inspect.signature(_decimal.Decimal.from_float)
<Signature (f, /)> As explained in the issue thread, the argument name is not a part of API. IMO, this pr makes docs a little worse.
Have you find some such code? |
Ugh, yuck. I'm not sure then. It's probably safest to force the Python implementation to be positional-only. |
There is a long list of issues, related to pydecimal/decimal incompatibilities (mostly closed), e.g. #117056.
I'm not sure if it does make sense to maintain it. We have a mature C extension and, IMO, the decimal module can be optional. |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
@terryjreedy This has already been backported see: 3.14, 3.13 |
fractions.Fraction.from_float
parameterf
is documented asflt
#136169📚 Documentation preview 📚: https://cpython-previews--136172.org.readthedocs.build/