launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #24923
[Merge] ~cjwatson/launchpad:builtin-pow into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:builtin-pow into launchpad:master.
Commit message:
Revert looptuner tests to using builtin pow()
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/386523
We switched to math.pow because Twisted Conch used gmpy which overrode __builtin__.pow. But Twisted Conch no longer uses gmpy, so that's no longer a problem.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:builtin-pow into launchpad:master.
diff --git a/lib/lp/services/doc/looptuner.txt b/lib/lp/services/doc/looptuner.txt
index aeb91cb..8c83471 100644
--- a/lib/lp/services/doc/looptuner.txt
+++ b/lib/lp/services/doc/looptuner.txt
@@ -324,9 +324,7 @@ compensates, then finally converges towards it.
If the cost function is highly regular and predictable, the oscillation will
be a neat alternation of oversized and undersized chunks.
-We use math.pow here, since __builtin__.pow is overridden by twisted.conch.
-
- >>> body = CostedLoop(lambda c: math.pow(1.2, c), 50)
+ >>> body = CostedLoop(lambda c: pow(1.2, c), 50)
>>> loop = CostedTuner(body, goal_seconds, 1)
>>> loop.run()
start
@@ -350,9 +348,7 @@ We use math.pow here, since __builtin__.pow is overridden by twisted.conch.
With more extreme exponential behaviour, the overshoot increases but the
effect remains the same:
-We use math.pow here, since __builtin__.pow is overridden by twisted.conch.
-
- >>> body = CostedLoop(lambda c: math.pow(3, c), 50)
+ >>> body = CostedLoop(lambda c: pow(3, c), 50)
>>> loop = CostedTuner(body, goal_seconds, 1)
>>> loop.run()
start