[WIP] [Python 3] Remove use of types module and basestring#179
Closed
JornVernee wants to merge 1 commit intograalvm:masterfrom
Closed
[WIP] [Python 3] Remove use of types module and basestring#179JornVernee wants to merge 1 commit intograalvm:masterfrom
JornVernee wants to merge 1 commit intograalvm:masterfrom
Conversation
Missing StringIO import use str instead of bytes since that seems to have been the intent (even though the 2to3 mapping tool says to use bytes)
Contributor
Author
|
Just did a force push since I realized a small mistake I made. The |
Contributor
Author
Contributor
Author
|
Needs some other changes as well, will update once the dependencies are done |
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.
Python 3.1 removes the builtin types from the
types.module, so it's use in that regard is non-portable. This PR changes the use oftypeswith builtin type names where appropriate.Additionally, since
basestringis no longer in Python 3, it's usage is exchanged forstr. The difference is thatbasestringis a common super type forunicodeandstr, so this is technically more restrictive, but also portable. I don't think usingstrinstead ofbasestringwill matter in practice, since it's only being used in type checks withisinstanceto check if something is a string, and almost all the code uses thestrtype, since it's the default for strings.