[issue25412] __floordiv__ in module fraction fails with TypeError instead of returning NotImplemented

Sergey Shashkov report at bugs.python.org
Thu Oct 15 10:12:59 EDT 2015


Sergey Shashkov added the comment:

def __floordiv__(a, b):
        """a // b"""
        if isinstance(b, numbers.Complex):
            return math.floor(a / b)
        else:
            return NotImplemented

And the same for __mod__.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25412>
_______________________________________


More information about the Python-bugs-list mailing list