From 8e67ac3b7672c1aa05c59bef29ad1b2c5520e07d Mon Sep 17 00:00:00 2001 From: Maxim Semenyuk <33791308+semenuk@users.noreply.github.com> Date: Sun, 10 Mar 2019 07:10:29 +0500 Subject: [PATCH] Fix '__bool__' method (#735) The method returns the truth when the stack is empty --- data_structures/stacks/stack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data_structures/stacks/stack.py b/data_structures/stacks/stack.py index 66af8c025..7f979d927 100644 --- a/data_structures/stacks/stack.py +++ b/data_structures/stacks/stack.py @@ -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)