Add count() method to collections.deque().

This commit is contained in:
Raymond Hettinger 2010-04-03 18:10:37 +00:00
parent 30583e3f38
commit 5f516edd77
4 changed files with 56 additions and 1 deletions

View file

@ -358,6 +358,12 @@ counts, but the output will exclude results with counts of zero or less.
Remove all elements from the deque leaving it with length 0.
.. method:: count(x)
Count the number of deque elements equal to *x*.
.. versionadded:: 2.7
.. method:: extend(iterable)
Extend the right side of the deque by appending elements from the iterable