(b, a)
| 709 | forward.__doc__ = monomorphic_operator.__doc__ |
| 710 | |
| 711 | def reverse(b, a): |
| 712 | if isinstance(a, numbers.Rational): |
| 713 | # Includes ints. |
| 714 | return monomorphic_operator(Fraction(a), b) |
| 715 | elif isinstance(a, numbers.Real): |
| 716 | return fallback_operator(float(a), float(b)) |
| 717 | elif handle_complex and isinstance(a, numbers.Complex): |
| 718 | return fallback_operator(complex(a), float(b)) |
| 719 | else: |
| 720 | return NotImplemented |
| 721 | reverse.__name__ = '__r' + fallback_operator.__name__ + '__' |
| 722 | reverse.__doc__ = monomorphic_operator.__doc__ |
| 723 |
no test coverage detected