[issue31099] Timer error pop from empty deque/list

Randy Henderson report at bugs.python.org
Tue Aug 1 18:21:55 EDT 2017


Randy Henderson added the comment:

You're right.  I was expecting the code in stmt to be run only once, but I
just discovered in the documentation that the default is for it to be run
one million times.  I provided the argument 'number=1' to the timeit()
method and am now getting the behavior I expected.  I'll remove/close the
bug entry.  Sorry -- newbie!

On Tue, Aug 1, 2017 at 1:58 PM, R. David Murray <report at bugs.python.org>
wrote:

>
> R. David Murray added the comment:
>
> Perhaps I'm missing something, but isn't this to be expected?  Timer will
> run d.popleft() repeatedly until you get the error you see because the list
> is empty.  Are you thinking that setup is run each time?  That would defeat
> its purpose.
>
> ----------
> nosy: +r.david.murray
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <http://bugs.python.org/issue31099>
> _______________________________________
>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue31099>
_______________________________________


More information about the Python-bugs-list mailing list