Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8a7687a

Browse files
committed
merge from 3.3
Document Fraction's numerator and denominator properties. Addresses issue #18800
2 parents 72460fa + b505a6a commit 8a7687a

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

Doc/library/fractions.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,22 @@ another rational number, or from a string.
7777
:class:`numbers.Rational`, and implements all of the methods and
7878
operations from that class. :class:`Fraction` instances are hashable,
7979
and should be treated as immutable. In addition,
80-
:class:`Fraction` has the following methods:
80+
:class:`Fraction` has the following properties and methods:
8181

8282
.. versionchanged:: 3.2
8383
The :class:`Fraction` constructor now accepts :class:`float` and
8484
:class:`decimal.Decimal` instances.
8585

8686

87+
.. attribute:: numerator
88+
89+
Numerator of the Fraction in lowest term.
90+
91+
.. attribute:: denominator
92+
93+
Denominator of the Fraction in lowest term.
94+
95+
8796
.. method:: from_float(flt)
8897

8998
This class method constructs a :class:`Fraction` representing the exact

0 commit comments

Comments
 (0)