diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2011-10-09 08:38:36 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2011-10-09 08:38:36 (GMT) |
commit | afe55bba33a20f87a58f940186359237064b428f (patch) | |
tree | 66d64a1518d79c3d0e90c0a1d0080cd88e887d99 /Objects/weakrefobject.c | |
parent | 67df285a3389c7fdb8c7bd301314ac45e17f8074 (diff) | |
download | cpython-afe55bba33a20f87a58f940186359237064b428f.zip cpython-afe55bba33a20f87a58f940186359237064b428f.tar.gz cpython-afe55bba33a20f87a58f940186359237064b428f.tar.bz2 |
Add API for static strings, primarily good for identifiers.
Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
Diffstat (limited to 'Objects/weakrefobject.c')
-rw-r--r-- | Objects/weakrefobject.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c index c99f6ba..594f0ea 100644 --- a/Objects/weakrefobject.c +++ b/Objects/weakrefobject.c @@ -440,8 +440,9 @@ proxy_checkref(PyWeakReference *proxy) #define WRAP_METHOD(method, special) \ static PyObject * \ method(PyObject *proxy) { \ + _Py_identifier(special); \ UNWRAP(proxy); \ - return PyObject_CallMethod(proxy, special, ""); \ + return _PyObject_CallMethodId(proxy, &PyId_##special, ""); \ } @@ -584,7 +585,7 @@ proxy_iternext(PyWeakReference *proxy) } -WRAP_METHOD(proxy_bytes, "__bytes__") +WRAP_METHOD(proxy_bytes, __bytes__) static PyMethodDef proxy_methods[] = { |