Fix '__bool__' method (#735)
The method returns the truth when the stack is empty
This commit is contained in:
committed by
Ashwek Swamy
parent
2c67f6161c
commit
8e67ac3b76
@@ -17,7 +17,7 @@ class Stack(object):
|
|||||||
self.limit = limit
|
self.limit = limit
|
||||||
|
|
||||||
def __bool__(self):
|
def __bool__(self):
|
||||||
return not bool(self.stack)
|
return bool(self.stack)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return str(self.stack)
|
return str(self.stack)
|
||||||
|
|||||||
Reference in New Issue
Block a user