-
-
Notifications
You must be signed in to change notification settings - Fork 656
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
Use syntax updated with Python 3.7 and avoid unnecessary list creations #2689
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bryant1410.
Overall it looks good, with a few issues:
BTW, the tests are failing for another reason, right? |
I think so. The failing test should be fixed by PR #2677, which was recently merged into |
Okay! I just merged instead of rebasing, hope it's fine. You can always rebase everything at the end, and I think it should remove the merge-type commits. |
BTW, I see the latest in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, no. It seems there's an issue with the diff. See comment below:
Currently three CI jobs are failing on this branch:
I recommend dropping this diff's change to Output from the test_tools CI job:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks @bryant1410!
I ran the following, which updates the code to syntax to Python >= 3.7:
pyupgrade $(find . -name "*.py" -type f) --py37-plus
This includes, for example, the Python-2 style of calling
super
and using f-strings where possible. I reviewed these changes manually.Also, I looked for unnecessary list comprehension creations, where a generator expression could have been created instead, thus saving memory and compute (though small if the lists were small).