Data Structure in Python like STL Stack?

Fredrik Lundh fredrik at
Mon Nov 28 16:15:02 CET 2005

Matt Keyes wrote:

> Is there a data structure in Python that is akin to the STL stack
> object in C++?

>>> import collections
>>> help(collections.deque)


class deque(__builtin__.object)
 |  deque(iterable) --> deque object
 |  Build an ordered collection accessible from endpoints only.



More information about the Python-list mailing list