Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Sorry, I don't think it's an improvement.
Old sentence is clear: we return a rational number with value numerator/denominator.
But original numerator and denominator may have any sign, may be not integers, etc.
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.
I agree with @skirpichev. We can leave "equals", but "where the denominator is positive" is incorrect or at least ambiguous. "Denominator" refers to the argument of the
Fractionconstructor, not thedenominatorproperty.Uh oh!
There was an error while loading. Please reload this page.
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.
I also agree. It's as if we require denomintor to be positive (as an argument) which is not the case. So I suggest to revert this PR.
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.
I opened pr to fix docstrings in Rational class: #136800 It's a accompanying pr to #122464, which fix sphinx docs (and stuck in review).
But maybe it's ok to combine both and include reversion of this pr? All that only affects docs and IMO - fine for backporting up to 3.13.
What do you think?
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.
@serhiy-storchaka @skirpichev we discussed this at the sprint and decided that
*denominator*(italics) referred to the argument, butdenominator(normal/roman) in the context of the sentence referred to the new argument. Regardless, it simplifies the arguments, so it is not always thedenominatorargument that is set as the class attribute.A
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.
It says: "a new :class:
Fractioninstance with value equal tonumerator/denominator". "denominator" refers to argument, not to the property. Otherwise this sentence does not make sense. Then you say that in "where the denominator is positive" "denominator" refers to something other. But it clearly refers to the same thing as in previous expression. Your interpretation requires interpreting the same word in two different ways simultaneously. Even if it makes sense, it is very unclear and confusing. And to me, it just looks wrong.