Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8e67ac3

Browse files
SemeniukMNashwek
authored andcommitted
Fix '__bool__' method (TheAlgorithms#735)
The method returns the truth when the stack is empty
1 parent 2c67f61 commit 8e67ac3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎data_structures/stacks/stack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __init__(self, limit=10):
1717
self.limit = limit
1818

1919
def __bool__(self):
20-
return notbool(self.stack)
20+
return bool(self.stack)
2121

2222
def __str__(self):
2323
return str(self.stack)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /