gh-105927: Remove _PyWeakref_GetWeakrefCount() (#106007)

Remove _PyWeakref_GetWeakrefCount() and _PyWeakref_ClearRef() from
the public C API: move them to the internal C API.

Refactor also _weakref_getweakrefs() code to make it more readable.
This commit is contained in:
Victor Stinner 2023-06-23 05:00:56 +02:00 committed by GitHub
parent 7b3ed5b29f
commit 6a80664ef1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 22 deletions

View file

@ -46,6 +46,10 @@ static inline int _PyWeakref_IS_DEAD(PyObject *ref_obj) {
return (Py_REFCNT(obj) == 0);
}
extern Py_ssize_t _PyWeakref_GetWeakrefCount(PyWeakReference *head);
extern void _PyWeakref_ClearRef(PyWeakReference *self);
#ifdef __cplusplus
}
#endif