Message73358
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. |
|
Date |
User |
Action |
Args |
2008-09-18 03:14:29 | roysmith | set | recipients:
+ roysmith, skip.montanaro, rhettinger |
2008-09-18 03:14:29 | roysmith | set | messageid: <1221707669.55.0.0929188085432.issue3891@psf.upfronthosting.co.za> |
2008-09-18 03:14:28 | roysmith | link | issue3891 messages |
2008-09-18 03:14:27 | roysmith | create | |
|