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

_PyWeakref_ClearRef and_PyWeakref_ClearWeakRefsExceptCallbacks should be exposed in 3.13 #118789

Closed
@colesbury

Description

@colesbury

_PyWeakref_ClearRef was previouslyexposed in the public C-API. In 3.13, it was moved topycore_weakref.h and the symbol is not exposed (i.e., it'sextern void instead ofPyAPI_FUNC(void).

_PyWeakref_ClearRef is used to clear a single weakref without calling its callback._PyWeakref_ClearWeakRefsExceptCallbacks is the thread-safe version. If people are using_PyWeakref_ClearRef, we'd rather they use_PyWeakref_ClearWeakRefsExceptCallbacks so that the code is thread-safe in the free-threading build.

One use case is to clear newly added weakrefs after you've called a finalizer, in case your C type does not delegate to subtype_dealloc.

Uses:

At a minimum, we should addPyAPI_FUNC to_PyWeakref_ClearRef and_PyWeakref_ClearWeakRefsExceptCallbacks and consider making_PyWeakref_ClearWeakRefsExceptCallbacks part of the public C API.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp