mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
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:
parent
7b3ed5b29f
commit
6a80664ef1
4 changed files with 20 additions and 22 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue