From c2a913d30b36f2d96bea3fc96cf686237823e9ba 2013-10-03 16:36:17 From: Thomas Kluyver Date: 2013-10-03 16:36:17 Subject: [PATCH] Merge pull request #4328 from abhinav-upadhyay/unused-variable Remove unused loop variable. --- diff --git a/IPython/core/magics/execution.py b/IPython/core/magics/execution.py index 795bbd2..f5614ab 100644 --- a/IPython/core/magics/execution.py +++ b/IPython/core/magics/execution.py @@ -982,7 +982,7 @@ python-profiler package from non-free.""") if number == 0: # determine number so that 0.2 <= total time < 2.0 number = 1 - for i in range(1, 10): + for _ in range(1, 10): if timer.timeit(number) >= 0.2: break number *= 10 @@ -1284,5 +1284,4 @@ def _format_time(timespan, precision=3): order = min(-int(math.floor(math.log10(timespan)) // 3), 3) else: order = 3 - ret = u"%.*g %s" % (precision, timespan * scaling[order], units[order]) - return ret + return u"%.*g %s" % (precision, timespan * scaling[order], units[order])