mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-18 16:27:02 +00:00
Fix '__bool__' method (#735)
The method returns the truth when the stack is empty
This commit is contained in:
parent
2c67f6161c
commit
8e67ac3b76
|
@ -17,7 +17,7 @@ class Stack(object):
|
|||
self.limit = limit
|
||||
|
||||
def __bool__(self):
|
||||
return not bool(self.stack)
|
||||
return bool(self.stack)
|
||||
|
||||
def __str__(self):
|
||||
return str(self.stack)
|
||||
|
|
Loading…
Reference in New Issue
Block a user