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 <1589814908.66.0.437066863038.issue40670@roundup.psfhosted.org>
In-reply-to
Content
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/timeit.py", line 232, in timeit
    return Timer(stmt, setup, timer, globals).timeit(number)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/timeit.py", 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)
0.0001043230000021822
History
Date User Action Args
2020-05-18 15:15:08remi.lapeyresetrecipients: + remi.lapeyre, anthonypjshaw, edison.abahurire
2020-05-18 15:15:08remi.lapeyresetmessageid: <1589814908.66.0.437066863038.issue40670@roundup.psfhosted.org>
2020-05-18 15:15:08remi.lapeyrelinkissue40670 messages
2020-05-18 15:15:08remi.lapeyrecreate