dbprocessing.DBqueue.DBqueue¶
- class dbprocessing.DBqueue.DBqueue[source]¶
General deque
Extension to
deque
to add methodspopiter()
andpopleftiter()
.- __init__(*args, **kwargs)¶
Methods
Add an element to the right side of the deque.
Add an element to the left side of the deque.
Remove all elements from the deque.
Return a shallow copy of a deque.
count
(value)Extend the right side of the deque with elements from the iterable
Extend the left side of the deque with elements from the iterable
index
(value, [start, [stop]])Raises ValueError if the value is not present.
D.insert(index, object) -- insert object before index
Remove and return the rightmost element.
popiter
()Allow a for loop to iterate and pop items from the DBqueue
Remove and return the leftmost element.
Allow a for loop to iterate and pop items from the DBqueue
D.remove(value) -- remove first occurrence of value.
D.reverse() -- reverse IN PLACE
Rotate the deque n steps to the right (default n=1).
Attributes
- append()¶
Add an element to the right side of the deque.
- appendleft()¶
Add an element to the left side of the deque.
- clear()¶
Remove all elements from the deque.
- copy()¶
Return a shallow copy of a deque.
- count(value) integer -- return number of occurrences of value ¶
- extend()¶
Extend the right side of the deque with elements from the iterable
- extendleft()¶
Extend the left side of the deque with elements from the iterable
- index(value[, start[, stop]]) integer -- return first index of value. ¶
Raises ValueError if the value is not present.
- insert()¶
D.insert(index, object) – insert object before index
- pop()¶
Remove and return the rightmost element.
- popiter()[source]¶
Allow a for loop to iterate and pop items from the DBqueue
- Yields
- any
Rightmost (last) item in queue.
Examples
>>> a = DBqueue([1,2,3]) >>> for i in a.poptiter(): ...: print(i) 3 2 1
- popleft()¶
Remove and return the leftmost element.
- popleftiter()[source]¶
Allow a for loop to iterate and pop items from the DBqueue
- Yields
- any
Leftmost (0th) item in queue.
Examples
>>> a = DBqueue([1,2,3]) >>> for i in a.popleftiter(): ...: print(i) 1 2 3
- remove()¶
D.remove(value) – remove first occurrence of value.
- reverse()¶
D.reverse() – reverse IN PLACE
- rotate()¶
Rotate the deque n steps to the right (default n=1). If n is negative, rotates left.
- maxlen¶
maximum size of a deque or None if unbounded
Release: 0.1.0 Doc generation date: Feb 10, 2022