Author hroncok
Recipients hroncok, vstinner
Date 2020-01-31.13:09:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1580476183.38.0.226752285705.issue39350@roundup.psfhosted.org>
In-reply-to
Content
Reproducer:

class myint(int):
    def __mul__(self, other):
        return type(self)(int(self)*int(other))
    @property
    def numerator(self):
        return type(self)(super().numerator)
    @property
    def denominator(self):
        return type(self)(super().denominator)


Before:

>>> fractions.Fraction(myint(1), myint(2))
Fraction(1, 2)


After:

>>> fractions.Fraction(myint(1), myint(2))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.9/fractions.py", line 164, in __new__
    g = _gcd(numerator, denominator)
NameError: name '_gcd' is not defined
History
Date User Action Args
2020-01-31 13:09:43hroncoksetrecipients: + hroncok, vstinner
2020-01-31 13:09:43hroncoksetmessageid: <1580476183.38.0.226752285705.issue39350@roundup.psfhosted.org>
2020-01-31 13:09:43hroncoklinkissue39350 messages
2020-01-31 13:09:43hroncokcreate