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 DeepSpace
Recipients DeepSpace
Date 2019-09-27.21:55:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1569621315.69.0.377751123288.issue38302@roundup.psfhosted.org>
In-reply-to
Content
Due to shared code between the 2 and 3 forms of pow, the following code causes a TypeError:

class A:
    def __init__(self, val):
        self.val = val
    
    def __ipow__(self, other):
        return NotImplemented

class B:
    def __init__(self, val):
        self.val = val
    
    def __rpow__(self, other):
        return A(other.val ** self.val)

a = A(2)
b = B(2)
a **= b


(https://stackoverflow.com/questions/58141475/ipow-raising-typeerror-when-left-hand-side-object-returns-notimplemented)
History
Date User Action Args
2019-09-27 21:55:15DeepSpacesetrecipients: + DeepSpace
2019-09-27 21:55:15DeepSpacesetmessageid: <1569621315.69.0.377751123288.issue38302@roundup.psfhosted.org>
2019-09-27 21:55:15DeepSpacelinkissue38302 messages
2019-09-27 21:55:15DeepSpacecreate