Peek at the top-most element of the stack.
(self)
| 36 | raise IndexError('pop from an empty stack') |
| 37 | |
| 38 | def peek(self): |
| 39 | """ Peek at the top-most element of the stack.""" |
| 40 | if self.stack: |
| 41 | return self.stack[-1] |
| 42 | |
| 43 | def is_empty(self): |
| 44 | """ Check if a stack is empty.""" |
no outgoing calls
no test coverage detected