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

gh-128213: fast path for bytes creation from list and tuple#132590

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

Open
eendebakpt wants to merge16 commits intopython:main
base:main
Choose a base branch
Loading
fromeendebakpt:fast-bytes-creation-from-list-tuple-2

Conversation

eendebakpt
Copy link
Contributor

@eendebakpteendebakpt commentedApr 16, 2025
edited by bedevere-appbot
Loading

Continuation of#128214. This PR

  • Improves performance of bytes creation from a list or tuple
  • Fixes a free-threading bug
  • Reduces some duplicated code between list and tuple handling

Comment on lines 2871 to 2872
/* Py_None as a fallback sentinel to the slow path */
bytes = Py_None;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/* Py_None as a fallback sentinel to the slow path */
bytes=Py_None;
/* Py_None as a fallback sentinel to the slow path */
Py_INCREF(Py_None);
bytes=Py_None;

Is needed, no?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Py_None is immortal, so not needed

@eendebakpteendebakpt marked this pull request as draftApril 16, 2025 12:41
eendebakptand others added4 commitsApril 16, 2025 14:58
…e-128213.Y71jDi.rstCo-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
@eendebakpteendebakpt marked this pull request as ready for reviewApril 16, 2025 14:09
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@StanFromIrelandStanFromIrelandAwaiting requested review from StanFromIreland

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@eendebakpt@StanFromIreland@blhsing

[8]ページ先頭

©2009-2025 Movatter.jp