summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-10-23 21:12:47 +0000
committerFred Drake <fdrake@acm.org>2001-10-23 21:12:47 +0000
commit0d429e8cdd98399b3c7eae55984463856de9281d (patch)
tree75ffac48ab921dca1da46c09eaa6e440ec25d432 /Modules/_weakref.c
parentDocumentation for the new PyArg_UnpackTuple() function. (diff)
downloadcpython-0d429e8cdd98399b3c7eae55984463856de9281d.tar.gz
cpython-0d429e8cdd98399b3c7eae55984463856de9281d.tar.bz2
cpython-0d429e8cdd98399b3c7eae55984463856de9281d.zip
Convert the ref() and proxy() implementations to use the new
PyArg_UnpackTuple() function (serves as an example and test case).
Diffstat (limited to 'Modules/_weakref.c')
-rw-r--r--Modules/_weakref.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_weakref.c b/Modules/_weakref.c
index 79873372b43..f797fbf00e7 100644
--- a/Modules/_weakref.c
+++ b/Modules/_weakref.c
@@ -69,7 +69,7 @@ weakref_ref(PyObject *self, PyObject *args)
PyObject *callback = NULL;
PyObject *result = NULL;
- if (PyArg_ParseTuple(args, "O|O:ref", &object, &callback)) {
+ if (PyArg_UnpackTuple(args, "ref", 1, 2, &object, &callback)) {
result = PyWeakref_NewRef(object, callback);
}
return result;
@@ -88,7 +88,7 @@ weakref_proxy(PyObject *self, PyObject *args)
PyObject *callback = NULL;
PyObject *result = NULL;
- if (PyArg_ParseTuple(args, "O|O:new", &object, &callback)) {
+ if (PyArg_UnpackTuple(args, "proxy", 1, 2, &object, &callback)) {
result = PyWeakref_NewProxy(object, callback);
}
return result;