[New-bugs-announce] [issue31099] Timer error pop from empty deque/list

Randy Henderson report at bugs.python.org
Tue Aug 1 16:50:29 EDT 2017

New submission from Randy Henderson:

Even when a deque is populated in the Timer setup parameter, the interpreter gives "IndexError: pop from an empty deque".  IndexError is generated for lists as well.

>>> Timer(stmt='d.popleft()',setup='d=deque([1,2,3])',globals=globals()).timeit()
Traceback (most recent call last):
  File "<pyshell#75>", line 1, in <module>
  File "C:\Program Files\Python\Python36\lib\timeit.py", line 178, in timeit
    timing = self.inner(it, self.timer)
  File "<timeit-src>", line 6, in inner
IndexError: pop from an empty deque

components: Library (Lib)
messages: 299634
nosy: Randy Henderson
priority: normal
severity: normal
status: open
title: Timer error pop from empty deque/list
versions: Python 3.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list