New submission from Roy Smith <[EMAIL PROTECTED]>:

Unless I'm missing something, the only way to tell if a deque is empty is 
to try and pop() something and catch the resulting IndexError.  This is 
not only awkward, but mutates the data structure when you may not want to.

It should be trivial to implement, and run in O(1) time.

----------
components: Library (Lib)
messages: 73344
nosy: roysmith
severity: normal
status: open
title: collections.deque should have empty() method
type: feature request
versions: Python 2.5

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3891>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to