## Stack


A generic stack data structure.


Usage


``` python
Stack(items=None)
```


## Parameters


`items: Optional[List[T]] = None`  
Initial items for the stack.


## Methods

| Name | Description |
|----|----|
| [is_empty()](#is_empty) | Check if the stack is empty. |
| [peek()](#peek) | View the top item without removing it. |
| [pop()](#pop) | Pop the top item from the stack. |
| [push()](#push) | Push an item onto the stack. |

------------------------------------------------------------------------


#### is_empty()


Check if the stack is empty.


Usage


``` python
is_empty()
```


##### Returns


`bool`  
True if empty.


------------------------------------------------------------------------


#### peek()


View the top item without removing it.


Usage


``` python
peek()
```


##### Returns


`T`  
The top item.


------------------------------------------------------------------------


#### pop()


Pop the top item from the stack.


Usage


``` python
pop()
```


##### Returns


`T`  
The item removed from the top.


##### Raises


`IndexError`  
If the stack is empty.


------------------------------------------------------------------------


#### push()


Push an item onto the stack.


Usage


``` python
push(item)
```


##### Parameters


`item: T`  
Item to push.
