[docs] docs for collections.deque do not mention how to check whether the deque is empty

Jason Sachs jmsachs at gmail.com
Sat Dec 21 00:16:08 CET 2013


http://docs.python.org/2/library/collections.html#collections.deque

If I have a deque containing a large number of items, and I just want to
know whether the deque is empty or not, I shouldn't have to call len().
 But the documentation does not mention any way to check to see if the
deque is empty without having to count the number of items.

It appears from what I've read on the internet (incl.
http://stackoverflow.com/questions/5652278/python-2-7-how-to-check-if-a-deque-is-empty)
that there is an implicit conversion to bool which returns True if the
deque contains any items, and returns False if the deque is empty.

If this is true, could you add this to the docs for deque?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20131220/1059baf7/attachment-0001.html>


More information about the docs mailing list