File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -571,9 +571,10 @@ Decimal objects
571571 >>> Decimal(321 ).exp()
572572 Decimal('2.561702493119680037517373933E+139')
573573
574- .. method :: from_float(f)
574+ .. classmethod :: from_float(f)
575575
576- Classmethod that converts a float to a decimal number, exactly.
576+ Alternative constructor that only accepts instances of :class: `float ` or
577+ :class: `int `.
577578
578579 Note `Decimal.from_float(0.1) ` is not the same as `Decimal('0.1') `.
579580 Since 0.1 is not exactly representable in binary floating point, the
Original file line number Diff line number Diff line change @@ -114,10 +114,10 @@ another rational number, or from a string.
114114
115115 .. versionadded :: 3.8
116116
117- .. method :: from_float(flt)
117+ .. classmethod :: from_float(flt)
118118
119- This class method constructs a :class: ` Fraction ` representing the exact
120- value of * flt *, which must be a :class: `float `. Beware that
119+ Alternative constructor which only accepts instances of
120+ :class: ` float ` or :class: `numbers.Integral `. Beware that
121121 ``Fraction.from_float(0.3) `` is not the same value as ``Fraction(3, 10) ``.
122122
123123 .. note ::
@@ -126,10 +126,10 @@ another rational number, or from a string.
126126 :class: `Fraction ` instance directly from a :class: `float `.
127127
128128
129- .. method :: from_decimal(dec)
129+ .. classmethod :: from_decimal(dec)
130130
131- This class method constructs a :class: ` Fraction ` representing the exact
132- value of * dec *, which must be a :class: `decimal.Decimal ` instance .
131+ Alternative constructor which only accepts instances of
132+ :class: `decimal.Decimal ` or :class: ` numbers.Integral ` .
133133
134134 .. note ::
135135
You can’t perform that action at this time.
0 commit comments