Changes between Version 2 and Version 12 of Ticket #24247
 Timestamp:
 11/22/17 08:12:31 (4 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

Ticket #24247

Property
Commit
changed from
to
0d3aa638f654dbc104ec85887eedfdb13e271589

Property
Dependencies
changed from
#24244
to#24248, #24259, #24260

Property
Branch
changed from
to
u/jdemeyer/implement___pow___in_the_coercion_model

Property
Commit
changed from

Ticket #24247 – Description
v2 v12 1 1 `__pow__` is harder than most other arithmetic coercions because you sometimes want the exponent to be an integer and sometimes you want full coercion. 2 2 3 To solve this, we first check whether the exponent is "integerlike". If so, we call `_pow_int`. If not, we do the usual coercion. 3 To solve this, we essentially do as follows: 4 5 1. If the arguments have equal parents, call `_pow_`. 6 7 2. If the exponent is "integerlike", call `_pow_int`. 8 9 3. If none of the above applies, do the usual coercion to a common parent. That will call `_pow_` unless the coerced arguments have a custom implementation of `__pow__`. 10 11 Furthermore, the 3argument version of `pow()` is not supported in the coercion model. Only specific types like `Integer` implement it. 4 12 5 13 This is related to Python 3 (see #16072) because this check for an integer needs to be changed in light of the changes to the `int`/`long` types.