This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ShashkovS
Recipients ShashkovS, mark.dickinson, oscarbenjamin, vstinner
Date 2015-10-16.20:44:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1445028261.63.0.295951081114.issue25412@psf.upfronthosting.co.za>
In-reply-to
Content
...
        def forward(a, b):
            if isinstance(b, (int, Fraction)):
                return monomorphic_operator(a, b)
            elif isinstance(b, float):
                return fallback_operator(float(a), b)
            elif isinstance(b, complex):
                return fallback_operator(complex(a), b)
            else:
                return NotImplemented
        forward.__name__ = '__' + fallback_operator.__name__ + '__'
        forward.__doc__ = monomorphic_operator.__doc__

        def reverse(b, a):
            if isinstance(a, numbers.Rational):
                # Includes ints.
                return monomorphic_operator(a, b)
            elif isinstance(a, numbers.Real):
                return fallback_operator(float(a), float(b))
            elif isinstance(a, numbers.Complex):
                return fallback_operator(complex(a), complex(b))
            else:
                return NotImplemented
...
so division is possible only with int, Fraction, float, complex, numbers.Rational, numbers.Real, numbers.Complex.
For all of them "isinstance(b, numbers.Complex)" is true
History
Date User Action Args
2015-10-16 20:44:21ShashkovSsetrecipients: + ShashkovS, mark.dickinson, vstinner, oscarbenjamin
2015-10-16 20:44:21ShashkovSsetmessageid: <1445028261.63.0.295951081114.issue25412@psf.upfronthosting.co.za>
2015-10-16 20:44:21ShashkovSlinkissue25412 messages
2015-10-16 20:44:21ShashkovScreate