Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update code to Python 3.11#29840

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
oscargus wants to merge1 commit intomatplotlib:mainfromoscargus:py311
Closed

Conversation

oscargus
Copy link
Member

PR summary

Depends on#29796

I just went thepyupgrade-route so not really sure which are actually related to dropping 3.10 and what is just old code that hangs around (like the%-formatting), but maybe just as good to get those things in as well?

PR checklist

@anntzer
Copy link
Contributor

tex strings formatting avoid using {} on purpose -- you just end up with way too many nested braces...

@oscargus
Copy link
MemberAuthor

Yeah, they looked quite bad. Will selectively revert those and fix some other things that "looked bad".

@timhoffm
Copy link
Member

I'd wait a bit with this until we're pretty sure there's no need for 3.10 support anymore. Not formally supporting it and actively breaking support are two pairs of shoes. Since the changes here have marginal benefits, I'd wait with them to close before/after the 3.11 release.

anntzer reacted with thumbs up emoji

@timhoffm
Copy link
Member

I'd wait a bit with this until we're pretty sure there's no need for 3.10 support anymore. Not formally supporting it and actively breaking support are two pairs of shoes. Since the changes here have marginal benefits, I'd wait with them to close before/after the 3.11 release.

Some of the changes here are not related to dropping 3.11 so could be pulled in right now (maybe runpyupgrade --py310-plus if you care to clean up older stuff now).

@oscargusoscargus marked this pull request as draftApril 3, 2025 07:55
@oscargus
Copy link
MemberAuthor

I've identified like four things here:

  • Getting rid of%-formatting: not good as it becomes lots of curly braces when used for LaTeX-like strings (almost all of the changes)
  • Location of typing imports: seems to be introduced in Python 3.11, but this is one that sort of makes sene
  • Location of UTC:datetime.UTC introduced in Python 3.11, also makes sense since it is slightly shorter
  • yield from instead of for-loop: cannot figure out version, but seems to maybe has been around for a bit, more pythonic

Hence, it is only the last one that actually can go in (and maybe a few well selected formats). Closing this for now and may reopen another one.

timhoffm reacted with thumbs up emoji

@timhoffm
Copy link
Member

yield from was introduced in Python 3.3:https://docs.python.org/3.3/whatsnew/3.3.html#pep-380-syntax-for-delegating-to-a-subgenerator

oscargus reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@oscargus@anntzer@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp