Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add a versionchanged sirective.
  • Loading branch information
serhiy-storchaka committed Jun 9, 2024
commit de5b4237d9c32abe50887f93037d424c8c23ee06
6 changes: 5 additions & 1 deletion Doc/library/fractions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ another rational number, or from a string.

The second version requires that
*number* is an instance of :class:`numbers.Rational` or is an instance
of :class:`numbers.Number` and has the :meth:`~as_integer_ratio` method
of :class:`numbers.Number` and has the :meth:`!as_integer_ratio` method
(this includes :class:`float` and :class:`decimal.Decimal`).
It returns a :class:`Fraction` instance with exactly the same value.
Comment thread
serhiy-storchaka marked this conversation as resolved.
Note that due to the
Expand Down Expand Up @@ -112,6 +112,10 @@ another rational number, or from a string.
Formatting of :class:`Fraction` instances without a presentation type
now supports fill, alignment, sign handling, minimum width and grouping.

.. versionchanged:: 3.14
The :class:`Fraction` constructor now accepts any numbers with the
:meth:`!as_integer_ratio` method.

.. attribute:: numerator

Numerator of the Fraction in lowest term.
Expand Down