SIGN IN SIGN UP

gh-118610: Centralize power caching in `_pylong.py` (#118611)

A new `compute_powers()` function computes all and only the powers of the base the various base-conversion functions need, as efficiently as reasonably possible (turns out that invoking `**`is needed at most once). This typically gives a few % speedup, but the primary point is to simplify the base-conversion functions, which no longer need their own, ad hoc, and less efficient power-caching schemes.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
T
Tim Peters committed
2f0a338be66e276a700f86af51d5ef54a138cbfb
Parent: 2a85bed
Committed by GitHub <noreply@github.com> on 5/8/2024, 12:09:09 AM