Opened 4 years ago

Last modified 4 years ago

#24247 closed enhancement

Implement __pow__ in the coercion model — at Version 2

Reported by: jdemeyer Owned by:
Priority: major Milestone: sage-8.2
Component: coercion Keywords:
Cc: Merged in:
Authors: Jeroen Demeyer Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #24244 Stopgaps:

Status badges

Description (last modified by jdemeyer)

__pow__ is harder than most other arithmetic coercions because you sometimes want the exponent to be an integer and sometimes you want full coercion.

To solve this, we first check whether the exponent is "integer-like". If so, we call _pow_int. If not, we do the usual coercion.

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.

Change History (2)

comment:1 Changed 4 years ago by jdemeyer

  • Description modified (diff)

comment:2 Changed 4 years ago by jdemeyer

  • Description modified (diff)
Note: See TracTickets for help on using tickets.