projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
43c7582
)
use type specific Py*_SetItem() functions
author
Stefan Behnel
<scoder@users.berlios.de>
Tue, 18 Nov 2008 20:06:09 +0000
(21:06 +0100)
committer
Stefan Behnel
<scoder@users.berlios.de>
Tue, 18 Nov 2008 20:06:09 +0000
(21:06 +0100)
Cython/Compiler/ExprNodes.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/ExprNodes.py
b/Cython/Compiler/ExprNodes.py
index f9e78cd453d5fb123a302dfbae22e0480fdcae67..f8a01f36f0f3aa4d24d5056f70bd347cbf588cdc 100644
(file)
--- a/
Cython/Compiler/ExprNodes.py
+++ b/
Cython/Compiler/ExprNodes.py
@@
-1656,8
+1656,15
@@
class IndexNode(ExprNode):
index_code = self.index.result()
code.globalstate.use_utility_code(setitem_int_utility_code)
else:
- function = "PyObject_SetItem"
index_code = self.index.py_result()
+ if self.base.type is dict_type:
+ function = "PyDict_SetItem"
+ elif self.base.type is list_type:
+ function = "PyList_SetItem"
+ elif self.base.type is tuple_type:
+ function = "PyTuple_SetItem"
+ else:
+ function = "PyObject_SetItem"
code.putln(
"if (%s(%s, %s, %s%s) < 0) %s" % (
function,