Fix '__bool__' method (#735)

The method returns the truth when the stack is empty
This commit is contained in:
Maxim Semenyuk 2019-03-10 07:10:29 +05:00 committed by Ashwek Swamy
parent 2c67f6161c
commit 8e67ac3b76

View File

@ -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)