Skip to content

Commit 762e14c

Browse files
committed
gh-122450: Expand numbers.Rational docstrings
1 parent eb8ac4c commit 762e14c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Lib/numbers.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,18 +290,24 @@ def conjugate(self):
290290

291291

292292
class Rational(Real):
293-
""".numerator and .denominator should be in lowest terms."""
293+
"""To Real, adds numerator and denominator properties.
294+
295+
The numerator and denominator values should be in lowest terms with
296+
denominator positive.
297+
"""
294298

295299
__slots__ = ()
296300

297301
@property
298302
@abstractmethod
299303
def numerator(self):
304+
"""The numerator of a rational number in lowest terms."""
300305
raise NotImplementedError
301306

302307
@property
303308
@abstractmethod
304309
def denominator(self):
310+
"""The positive denominator of a rational number in lowest terms."""
305311
raise NotImplementedError
306312

307313
# Concrete implementation of Real's conversion to float.

0 commit comments

Comments
 (0)