@@ -31,35 +31,37 @@ Classes
31
31
32
32
- *flag * is optional and can be set to 1 to check for overflow when
33
33
adding items. If the deque is full and overflow checking is enabled,
34
- an IndexError will be raised when adding items.
34
+ an `` IndexError `` will be raised when adding items.
35
35
36
36
Deque objects have the following methods:
37
37
38
38
.. method :: deque.append(x)
39
39
40
40
Add *x * to the right side of the deque.
41
- Raises IndexError if overflow checking is enabled and there is no more room left.
41
+ Raises ``IndexError `` if overflow checking is enabled and there is
42
+ no more room in the queue.
42
43
43
44
.. method :: deque.appendleft(x)
44
45
45
46
Add *x * to the left side of the deque.
46
- Raises IndexError if overflow checking is enabled and there is no more room left.
47
+ Raises ``IndexError `` if overflow checking is enabled and there is
48
+ no more room in the queue.
47
49
48
50
.. method :: deque.pop()
49
51
50
52
Remove and return an item from the right side of the deque.
51
- Raises IndexError if no items are present.
53
+ Raises `` IndexError `` if no items are present.
52
54
53
55
.. method :: deque.popleft()
54
56
55
57
Remove and return an item from the left side of the deque.
56
- Raises IndexError if no items are present.
58
+ Raises `` IndexError `` if no items are present.
57
59
58
60
.. method :: deque.extend(iterable)
59
61
60
- Extend the right side of the deque by appending items from the * iterable * argument.
62
+ Extend the right side of the deque by appending items from the `` iterable `` argument.
61
63
Raises IndexError if overflow checking is enabled and there is no more room left
62
- for all of the items in * iterable * .
64
+ for all of the items in `` iterable `` .
63
65
64
66
In addition to the above, deques support iteration, ``bool ``, ``len(d) ``, ``reversed(d) ``,
65
67
membership testing with the ``in `` operator, and subscript references like ``d[0] ``.
0 commit comments