]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-122450: Indicate that `Fraction` denominators are always positive (#136789)
authornacind <107233139+nacind@users.noreply.github.com>
Sat, 19 Jul 2025 11:26:50 +0000 (13:26 +0200)
committerGitHub <noreply@github.com>
Sat, 19 Jul 2025 11:26:50 +0000 (13:26 +0200)
Doc/library/fractions.rst

index 392b6d40e861fbdd9dae860b1a47748560c5e59c..8796056b4b8722c4ec91d89c8110b96d4a49d7e4 100644 (file)
@@ -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