Skip to content

Commit

Permalink
Fix '__bool__' method (TheAlgorithms#735)
Browse files Browse the repository at this point in the history
The method returns the truth when the stack is empty
  • Loading branch information
SemeniukMN authored and ashwek committed Mar 10, 2019
1 parent 2c67f61 commit 8e67ac3
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit 8e67ac3

Please sign in to comment.