Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix '__bool__' method
The method returns the truth when the stack is empty
  • Loading branch information
SemeniukMN authored Mar 9, 2019
commit 613df20d5781640d338111d7ec81ab4a4cbe7a10
2 changes: 1 addition & 1 deletion data_structures/stacks/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, limit=10):
self.limit = limit

def __bool__(self):
return not bool(self.stack)
return bool(self.stack)

def __str__(self):
return str(self.stack)
Expand Down