Sergey Shashkov added the comment:
Bad idea, just
def __floordiv__(a, b):
"""a // b"""
if isinstance(b, numbers.Complex):
return math.floor(a / b)
else:
return NotImplemented
If b is inherited from number, real, complex, Fraction and etc, then a of type
Fraction knows, how do make a division.
Otherwise may be b has __rfloordiv__, that khows how to be divided by Fraction.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue25412>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com