https://github.com/python/cpython/commit/eb8ac4c85773160a6104abafdea9159f26363a9b
commit: eb8ac4c85773160a6104abafdea9159f26363a9b
branch: main
author: nacind <[email protected]>
committer: AA-Turner <[email protected]>
date: 2025-07-19T13:26:50+02:00
summary:
gh-122450: Indicate that `Fraction` denominators are always positive (#136789)
files:
M Doc/library/fractions.rst
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
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]