Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize classes to use Python 3 syntax #7937

Merged
merged 9 commits into from Jun 23, 2019

Conversation

Eric-Arellano
Copy link
Contributor

Python 3 makes it repetitive to subclass object and to call the verbose form of super().

We use this script to update the codebase to use the simpler style, excluding the contrib.python.checks.checker package. The main part of this script is these two regex substitutions:

re.sub(r"super\([a-zA-Z]+, [a-z]+\)", "super()")
re.sub(r"class (?P<className>[a-zA-Z]*)\(object\):", r"class \g<className>:")

@Eric-Arellano
Copy link
Contributor Author

This depends on #7934 to be merged for green CI.

Each commit may be independently reviewed.

Copy link
Member

@jsirois jsirois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My review of cf1d38d was cursory, but the other commits definitely look good.

@Eric-Arellano
Copy link
Contributor Author

My review of cf1d38d was cursory, but the other commits definitely look good.

I did a close review of it, which is what resulted in 0042167. Will likely closely review one more time before merging. Hoping CI will catch issues as well.

Thanks for the review!

SKIP_FULL_CI  # Documentation-only change.

# Delete this line to force a full CI run for documentation-only changes.
SKIP_FULL_CI  # Documentation-only change.

# Delete this line to force a full CI run for documentation-only changes.
SKIP_FULL_CI  # Documentation-only change.
I'm not sure why this is necessary, but it is.
@Eric-Arellano Eric-Arellano marked this pull request as ready for review June 23, 2019 00:43
@Eric-Arellano Eric-Arellano merged commit 14e0bd6 into pantsbuild:master Jun 23, 2019
@Eric-Arellano Eric-Arellano deleted the modernize-classes branch June 23, 2019 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants