For collections.deque() objects, expose the maxlen parameter as a read-only attribute.

This commit is contained in:
Raymond Hettinger 2009-03-10 12:56:32 +00:00
parent 060c7f6bba
commit 5bb0f0e072
4 changed files with 36 additions and 1 deletions

View file

@ -361,6 +361,15 @@ counts, but the output will exclude results with counts of zero or less.
``d.appendleft(d.pop())``.
Deque objects also provide one read-only attribute:
.. attribute:: maxlen
Maximum size of a deque or *None* if unbounded.
.. versionadded:: 2.7
In addition to the above, deques support iteration, pickling, ``len(d)``,
``reversed(d)``, ``copy.copy(d)``, ``copy.deepcopy(d)``, membership testing with
the :keyword:`in` operator, and subscript references such as ``d[-1]``. Indexed