Skip to content

Commit 8e67ac3

Browse files
SemeniukMNashwek
authored andcommitted
Fix '__bool__' method (#735)
The method returns the truth when the stack is empty
1 parent 2c67f61 commit 8e67ac3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

data_structures/stacks/stack.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __init__(self, limit=10):
1717
self.limit = limit
1818

1919
def __bool__(self):
20-
return not bool(self.stack)
20+
return bool(self.stack)
2121

2222
def __str__(self):
2323
return str(self.stack)

0 commit comments

Comments
 (0)