From e07d2f699c27f18908819d319acf30589cd9c46e Mon Sep 17 00:00:00 2001 From: nacind <107233139+nacind@users.noreply.github.com> Date: Sat, 19 Jul 2025 13:26:50 +0200 Subject: [PATCH] gh-122450: Indicate that `Fraction` denominators are always positive (GH-136789) (cherry picked from commit eb8ac4c85773160a6104abafdea9159f26363a9b) Co-authored-by: nacind <107233139+nacind@users.noreply.github.com> --- Doc/library/fractions.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/fractions.rst b/Doc/library/fractions.rst index 392b6d40e861fb..8796056b4b8722 100644 --- a/Doc/library/fractions.rst +++ b/Doc/library/fractions.rst @@ -25,8 +25,8 @@ another rational number, or from a string. The first version requires that *numerator* and *denominator* are instances of :class:`numbers.Rational` and returns a new :class:`Fraction` instance - with value ``numerator/denominator``. If *denominator* is ``0``, it - raises a :exc:`ZeroDivisionError`. + with value equal to ``numerator/denominator`` where the denominator is positive. + If *denominator* is ``0``, it raises a :exc:`ZeroDivisionError`. The second version requires that *number* is an instance of :class:`numbers.Rational` or has the :meth:`!as_integer_ratio` method