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 roysmith
Recipients rhettinger, roysmith, skip.montanaro
Date 2008-09-18.03:14:27
SpamBayes Score 2.6440894e-09
Marked as misclassified No
Message-id <1221707669.55.0.0929188085432.issue3891@psf.upfronthosting.co.za>
In-reply-to
Content
In retrospect, it's obvious that "while mydeque" is indeed the way to 
process the queue, yet, when I was reading the docs, I didn't come away 
with that.

The statement, "list objects support similar operations", is wishy-washy.  
It is not the same as saying "deque is a subclass of list" (which isn't 
true), nor "the set of operations supported by deque is a superset of 
those supported by list" (which also isn't true).  Thus, you're left 
having to interpret the statement as a handwave that deques are sort-of 
list-like things, with some (indeterminate) set of operations in common.  
It's not at all obvious (or at least it wasn't to me) that one of those 
operations is evaluating the container in a boolean context to test for 
emptiness.

Anyway, to more concretely answer your question, I'd just make the plain 
statement, "An empty deque evaluates as false", somewhere right on the 
page where the methods are listed.
History
Date User Action Args
2008-09-18 03:14:29roysmithsetrecipients: + roysmith, skip.montanaro, rhettinger
2008-09-18 03:14:29roysmithsetmessageid: <1221707669.55.0.0929188085432.issue3891@psf.upfronthosting.co.za>
2008-09-18 03:14:28roysmithlinkissue3891 messages
2008-09-18 03:14:27roysmithcreate