Use the correct data structures for exceptions#348
Open
NyanHelsing wants to merge 1 commit intoCenterForOpenScience:developfrom
Open
Use the correct data structures for exceptions#348NyanHelsing wants to merge 1 commit intoCenterForOpenScience:developfrom
NyanHelsing wants to merge 1 commit intoCenterForOpenScience:developfrom
Conversation
A tuple is the correct data struuucture for cases where the position in the structure has meaning rather than significance, so a list of tuples is the correct data structure for the stack here.
cslzchen
reviewed
Aug 13, 2018
Contributor
cslzchen
left a comment
There was a problem hiding this comment.
Looks good to me. 🎆 Tuple makes more sense than list here. Just one more thing to double check. Do we have any usage of the self.attr_stack that may expecting a list for the error and message? If so, we need to update them as well.
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.
Ticket
No ticket
Purpose
A tuple is the correct data structure for cases where the position in
the structure has meaning rather than being ordered, so a list of tuples
is the correct data structure for the stack here.
A couple links to relevant discussion:
https://docs.python.org/3/tutorial/datastructures.html#tuples-and-sequences
http://jtauber.com/blog/2006/04/15/python_tuples_are_not_just_constant_lists/
https://stackoverflow.com/questions/626759/whats-the-difference-between-lists-and-tuples
Changes
Replace lists where tuples are more correct
Side effects
Doubtful
QA Notes
N/A
Deployment Notes
N/A