cpython: 661cdbd617b8 (original) (raw)
Mercurial > cpython
changeset 95830:661cdbd617b8
Issue #23910: Optimize property() getter calls. Patch by Joe Jevnik [#23910]
Raymond Hettinger python@rcn.com | |
---|---|
date | Thu, 30 Apr 2015 08:08:13 -0700 |
parents | 5d065807a05f |
children | 6f6e78931875 |
files | Misc/NEWS Objects/descrobject.c |
diffstat | 2 files changed, 11 insertions(+), 1 deletions(-)[+] [-] Misc/NEWS 2 Objects/descrobject.c 10 |
line wrap: on
line diff
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -13,6 +13,8 @@ Core and Builtins
- Issue #23996: Avoid a crash when a delegated generator raises an unnormalized StopIteration exception. Patch by Stefan Behnel. +- Issue #23910: Optimize property() getter calls. Patch by Joe Jevnik. +
- Issue #24022: Fix tokenizer crash when processing undecodable source code.
- Issue #9951: Added a hex() method to bytes, bytearray, and memoryview.
--- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -1372,6 +1372,8 @@ property_dealloc(PyObject *self) static PyObject * property_descr_get(PyObject *self, PyObject *obj, PyObject *type) {
- static PyObject *args = NULL;
- PyObject *ret; propertyobject *gs = (propertyobject *)self; if (obj == NULL || obj == Py_None) { @@ -1382,7 +1384,13 @@ property_descr_get(PyObject *self, PyObj PyErr_SetString(PyExc_AttributeError, "unreadable attribute"); return NULL; }