Brett Cannon <[email protected]> added the comment:
It turns out **= ONLY calls __ipow__ and neither __pow__ or __rpow__ as the data model says should be called. - Data Model: https://docs.python.org/3/reference/datamodel.html#object.__ipow__ - PyNumber_InPlacePower(): https://github.com/python/cpython/blob/802726acf6048338394a6a4750835c2cdd6a947b/Objects/abstract.c#L1159 - ternary_op (which is what is used to implement PyNumber_InPlacePower(): https://github.com/python/cpython/blob/802726acf6048338394a6a4750835c2cdd6a947b/Objects/abstract.c#L849 ---------- nosy: +brett.cannon priority: normal -> high title: __rpow__ not reached when __ipow__ returns NotImplemented -> __pow__ and __rpow__ are not reached when __ipow__ returns NotImplemented for **= versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.6, Python 3.7 _______________________________________ Python tracker <[email protected]> <https://bugs.python.org/issue38302> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
