fix running of set_up_configuration() in Python 3#2723
Merged
bartoldeman merged 9 commits intoeasybuilders:4.xfrom Jan 16, 2019
Merged
fix running of set_up_configuration() in Python 3#2723bartoldeman merged 9 commits intoeasybuilders:4.xfrom
bartoldeman merged 9 commits intoeasybuilders:4.xfrom
Conversation
…eralOption.generate_cmd_line
bartoldeman
reviewed
Jan 16, 2019
Contributor
bartoldeman
left a comment
There was a problem hiding this comment.
Overall it looks good to me. Just, when porting code to Python 3 years ago I found it nice to take advantage of iterability of dicts, which behave the same way in 2 and 3, unlike keys() vs iterkeys().
So I generally avoided all use of keys(), items(), values() and iterated over the dict instead, using list to make a copy of the keys if necessary. Sometimes the sorted() function comes in handy too.
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.
Just to clarify: this involves changing a bunch of string values (
'...') to byte strings (b'...').In Python 2.6 and 2.7,
'...'andb'...'are exactly the same thing, but in Python 3 there's an important distinction between'...'andb'...', see for example https://eli.thegreenplace.net/2012/01/30/the-bytesstr-dichotomy-in-python-3.In some cases, byte strings are produced in Python 3, and we need to take this into account when working on those values...