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

Add PyUnstable_SetImmortal#164

Merged
vstinner merged 8 commits intopython:mainfrom
kumaraditya303:main
Feb 12, 2026
Merged

Add PyUnstable_SetImmortal#164
vstinner merged 8 commits intopython:mainfrom
kumaraditya303:main

Conversation

@kumaraditya303
Copy link
Contributor

No description provided.

Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

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

Please document the new function in docs/changelog.rst and docs/api.rst.

@kumaraditya303kumaraditya303 marked this pull request as ready for reviewFebruary 12, 2026 12:32
kumaraditya303and others added2 commitsFebruary 12, 2026 18:11
Co-authored-by: Victor Stinner <vstinner@python.org>
Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

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

I agree to not add Python 3.12 support.

It's tempting to add Python 3.12 support, but Python 3.12 semantics is different:

staticinlinevoid_Py_SetImmortal(PyObject*op){if (op) {op->ob_refcnt=_Py_IMMORTAL_REFCNT;    }}
  • Different API: it has no return value (void)!
  • It doesn't reject Unicode objects.
  • It doesn't untrack objects in the GC.
// Immortal objects were implemented in Python 3.12, however there is no easy API// to make objects immortal until 3.14 which has _Py_SetImmortal(). Since// immortal objects are primarily needed for free-threading, this API is implemented// for 3.14 using _Py_SetImmortal() and uses private macros on 3.13.

I agree thatPyUnstable_SetImmortal() is mostly useful on free-threaded builds, so it's ok to skip Python 3.12.

Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

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

LGTM.

@vstinner
Copy link
Member

Good, the tests passed successfully on Python 3.13 on regular build and free-threaded build:

  • Build / build (macos-latest, 3.13) (pull_request)
  • Build / build (macos-latest, 3.13t) (pull_request)

@vstinnervstinner merged commit8636bcc intopython:mainFeb 12, 2026
36 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@vstinnervstinnervstinner approved these changes

+1 more reviewer

@ngoldbaumngoldbaumngoldbaum left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@kumaraditya303@vstinner@ngoldbaum

[8]ページ先頭

©2009-2026 Movatter.jp