Updated Stack#2414
Merged
cclauss merged 4 commits intoTheAlgorithms:masterfrom Sep 13, 2020
realDuYuanChao:dev
Merged
Conversation
* Added test * Formated code
Member
Author
|
@cclauss Please review. Thanks :) |
cclauss
reviewed
Sep 10, 2020
data_structures/stacks/stack.py
Outdated
Comment on lines
29
to
30
| if self.is_empty(): | ||
| raise IndexError("pop from an empty stack") |
Member
There was a problem hiding this comment.
Does it do exactly the same thing if you remove lines 29 and 30?
cclauss
reviewed
Sep 10, 2020
data_structures/stacks/stack.py
Outdated
Comment on lines
35
to
36
| if self.is_empty(): | ||
| raise IndexError("peek from an empty stack") |
Member
There was a problem hiding this comment.
Does it do a similar thing if you remove lines 35 and 36?
Member
Author
There was a problem hiding this comment.
Line3 35 and 36 execute when stack is empty. assert() statements will still be successful if i remove them .
swapnanildutta
approved these changes
Sep 12, 2020
Member
Author
|
Need I update @cclauss ? |
Member
Author
|
Thanks @cclauss . Nice updates. LGTM 👍 |
cclauss
approved these changes
Sep 13, 2020
stokhos
pushed a commit
to stokhos/Python
that referenced
this pull request
Jan 3, 2021
* * Added type hints
* Added test
* Formated code
* updating DIRECTORY.md
* Update stack.py
* Test error conditions for pop, peek, and
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}.