Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Upgrade code to Python 3.10 #28599

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

Merged
merged 7 commits into from
Jul 24, 2024
Merged

Upgrade code to Python 3.10 #28599

merged 7 commits into from
Jul 24, 2024

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Jul 20, 2024

PR summary

I missed a few typing things in the previous Python 3.10 PR, and I also ran ruff with its pyupgrade options to find a few more things. See commits for further details.

PR checklist

Copy link
Member

@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

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

Looks good, but needs a rebase.

@tacaswell
Copy link
Member

The rebase will also fix the pyqt issue.

QuLogic added 7 commits July 22, 2024 15:45
- UP027: Replace unpacked list comprehensions with generator
  expressions; these are supposedly more efficient since no temporary
  list is created.
- RUF015: Replace accessing the first element of an evaluated list with
  `next(iter(...))`, avoiding the temporary list.
- RUF017: Replace quadratic `sum(list of list, [])` with faster
  `functools.reduce` implementation.
This was added in 3.10.
@ksunden ksunden merged commit 73a731b into matplotlib:main Jul 24, 2024
38 of 40 checks passed
@QuLogic QuLogic deleted the pyupgrade branch July 24, 2024 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants