Skip to content

Commit aba94d4

Browse files
author
Paul Becker
committed
Fix division by zero
Please enter the commit message for your changes. Lines starting
1 parent 7245630 commit aba94d4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/fractions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class Fraction(numbers.Rational):
203203
__slots__ = ('_numerator', '_denominator')
204204

205205
# We're immutable, so use __new__ not __init__
206-
def __new__(cls, numerator=0, denominator=None):
206+
def __new__(cls, numerator=0, denominator=1):
207207
"""Constructs a Rational.
208208
209209
Takes a string like '3/2' or '1.5', another Rational instance, a

0 commit comments

Comments
 (0)