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

Commitbb5bf24

Browse files
[3.13]gh-118789: Restore hidden_PyWeakref_ClearRef (GH-118797) (GH-118903)
gh-118789: Restore hidden `_PyWeakref_ClearRef` (GH-118797)_PyWeakref_ClearRef was previously exposed in the public C-API, althoughit begins with an underscore and is not documented. It's used by a fewC-API extensions. There is currently no alternative public API that canreplace its use._PyWeakref_ClearWeakRefsExceptCallbacks is the only thread-safe way touse _PyWeakref_ClearRef in the free-threaded build. This exposes the Csymbol, but does not make the API public.(cherry picked from commitdb5af7d)Co-authored-by: Sam Gross <colesbury@gmail.com>
1 parent93fce2d commitbb5bf24

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

‎Include/cpython/weakrefobject.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ struct _PyWeakReference {
4040
#endif
4141
};
4242

43+
PyAPI_FUNC(void)_PyWeakref_ClearRef(PyWeakReference*self);
44+
4345
Py_DEPRECATED(3.13)staticinlinePyObject*PyWeakref_GET_OBJECT(PyObject*ref_obj)
4446
{
4547
PyWeakReference*ref;

‎Include/internal/pycore_weakref.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ extern Py_ssize_t _PyWeakref_GetWeakrefCount(PyObject *obj);
111111
// intact.
112112
externvoid_PyWeakref_ClearWeakRefsExceptCallbacks(PyObject*obj);
113113

114-
externvoid_PyWeakref_ClearRef(PyWeakReference*self);
115-
116114
PyAPI_FUNC(int)_PyWeakref_IsDead(PyObject*weakref);
117115

118116
#ifdef__cplusplus
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Restore ``_PyWeakref_ClearRef`` that was previously removed in Python 3.13
2+
alpha 1.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp