From 8e51e4d89ba59e56412e3982408b815e575ea656 2013-02-05 11:26:25 From: Robert Marchman Date: 2013-02-05 11:26:25 Subject: [PATCH] warning for %%timeit empty cell Notifies user if they run %%timeit with an empty cell block - see issue #2862. --- diff --git a/IPython/core/magics/execution.py b/IPython/core/magics/execution.py index 66ee259..8a1552f 100644 --- a/IPython/core/magics/execution.py +++ b/IPython/core/magics/execution.py @@ -776,6 +776,10 @@ python-profiler package from non-free.""") posix=False, strict=False) if stmt == "" and cell is None: return + elif cell == '': + warn("Empty cell. Did you mean to use %timeit?") + return + timefunc = timeit.default_timer number = int(getattr(opts, "n", 0)) repeat = int(getattr(opts, "r", timeit.default_repeat))