Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c4e335b6
Commit
c4e335b6
authored
Apr 30, 2015
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #23910: Optimize property() getter calls. Patch by Joe Jevnik
parent
dd2693fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
Misc/NEWS
Misc/NEWS
+2
-0
Objects/descrobject.c
Objects/descrobject.c
+9
-1
No files found.
Misc/NEWS
View file @
c4e335b6
...
...
@@ -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.
...
...
Objects/descrobject.c
View file @
c4e335b6
...
...
@@ -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, PyObject *obj, PyObject *type)
PyErr_SetString
(
PyExc_AttributeError
,
"unreadable attribute"
);
return
NULL
;
}
return
PyObject_CallFunctionObjArgs
(
gs
->
prop_get
,
obj
,
NULL
);
if
(
!
args
&&
!
(
args
=
PyTuple_New
(
1
)))
{
return
NULL
;
}
PyTuple_SET_ITEM
(
args
,
0
,
obj
);
ret
=
PyObject_Call
(
gs
->
prop_get
,
args
,
NULL
);
PyTuple_SET_ITEM
(
args
,
0
,
NULL
);
return
ret
;
}
static
int
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment