This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author remi.lapeyre
Recipients anthonypjshaw, edison.abahurire, remi.lapeyre
Date 2020-05-18.15:15:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Is this different than what you would expect?

Supplying garbage to timeit will result in an error:

>>> from timeit import timeit
>>> timeit('weofinwofinwe')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/", line 232, in timeit
    return Timer(stmt, setup, timer, globals).timeit(number)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/", line 176, in timeit
    timing = self.inner(it, self.timer)
  File "<timeit-src>", line 6, in inner
NameError: name 'weofinwofinwe' is not defined

If you want to time an empty loop, you can use:

>>> timeit('pass', number=10000)
Date User Action Args
2020-05-18 15:15:08remi.lapeyresetrecipients: + remi.lapeyre, anthonypjshaw, edison.abahurire
2020-05-18 15:15:08remi.lapeyresetmessageid: <>
2020-05-18 15:15:08remi.lapeyrelinkissue40670 messages
2020-05-18 15:15:08remi.lapeyrecreate