>>> S = Stack() >>> S.is_full() False >>> S = Stack(1) >>> S.push(10) >>> S.is_full() True
(self)
| 108 | return not bool(self.stack) |
| 109 | |
| 110 | def is_full(self) -> bool: |
| 111 | """ |
| 112 | >>> S = Stack() |
| 113 | >>> S.is_full() |
| 114 | False |
| 115 | |
| 116 | >>> S = Stack(1) |
| 117 | >>> S.push(10) |
| 118 | >>> S.is_full() |
| 119 | True |
| 120 | """ |
| 121 | return self.size() == self.limit |
| 122 | |
| 123 | def size(self) -> int: |
| 124 | """ |