Collection Attributes

collections.deque.maxlen

Read-only capacity bound; None denotes an unbounded deque. Zero allows no retained items.

Formal Syntax & Structure

python syntaxpython
deque_instance.maxlen

Return Value

int or None

The int or None result described above.

Working Example

Example Snippetpython
import collectionsd=collections.deque([1],maxlen=4)print(d.maxlen)
Python Reference