[issue38302] __pow__ and __rpow__ are not reached when __ipow__ returns NotImplemented for **=

2020-09-01 Thread Brett Cannon


Brett Cannon  added the comment:

I have opened https://bugs.python.org/issue41688 to track the documentation 
fixes so that this can become a release blocker for Python 3.10.

--
priority: high -> release blocker
versions:  -Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38302] __pow__ and __rpow__ are not reached when __ipow__ returns NotImplemented for **=

2020-08-23 Thread Brett Cannon


Brett Cannon  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com