summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-06-26 10:10:53 (GMT)
committerGitHub <noreply@github.com>2023-06-26 10:10:53 (GMT)
commitc075a1974b0dce9801cb645c77faa8af612b3db5 (patch)
tree9d11e456048a42b7ba912dac1c99dd137c2442b8 /Include
parentdac3d389e747c6f6ef17e4e2f38731c8ef83eada (diff)
downloadcpython-c075a1974b0dce9801cb645c77faa8af612b3db5.zip
cpython-c075a1974b0dce9801cb645c77faa8af612b3db5.tar.gz
cpython-c075a1974b0dce9801cb645c77faa8af612b3db5.tar.bz2
gh-105927: Deprecate PyWeakref_GetObject() function (#106006)
Deprecate PyWeakref_GetObject() and PyWeakref_GET_OBJECT() functions.
Diffstat (limited to 'Include')
-rw-r--r--Include/cpython/weakrefobject.h3
-rw-r--r--Include/weakrefobject.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/Include/cpython/weakrefobject.h b/Include/cpython/weakrefobject.h
index 6bf1655..1559e2d 100644
--- a/Include/cpython/weakrefobject.h
+++ b/Include/cpython/weakrefobject.h
@@ -32,7 +32,8 @@ struct _PyWeakReference {
vectorcallfunc vectorcall;
};
-static inline PyObject* PyWeakref_GET_OBJECT(PyObject *ref_obj) {
+Py_DEPRECATED(3.13) static inline PyObject* PyWeakref_GET_OBJECT(PyObject *ref_obj)
+{
PyWeakReference *ref;
PyObject *obj;
assert(PyWeakref_Check(ref_obj));
diff --git a/Include/weakrefobject.h b/Include/weakrefobject.h
index 2c69f9e..727ba69 100644
--- a/Include/weakrefobject.h
+++ b/Include/weakrefobject.h
@@ -27,7 +27,7 @@ PyAPI_FUNC(PyObject *) PyWeakref_NewRef(PyObject *ob,
PyObject *callback);
PyAPI_FUNC(PyObject *) PyWeakref_NewProxy(PyObject *ob,
PyObject *callback);
-PyAPI_FUNC(PyObject *) PyWeakref_GetObject(PyObject *ref);
+Py_DEPRECATED(3.13) PyAPI_FUNC(PyObject *) PyWeakref_GetObject(PyObject *ref);
PyAPI_FUNC(int) PyWeakref_GetRef(PyObject *ref, PyObject **pobj);