projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a00905e
)
comment
author
Stefan Behnel
<scoder@users.berlios.de>
Thu, 26 Nov 2009 19:51:20 +0000
(20:51 +0100)
committer
Stefan Behnel
<scoder@users.berlios.de>
Thu, 26 Nov 2009 19:51:20 +0000
(20:51 +0100)
Cython/Compiler/Optimize.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/Optimize.py
b/Cython/Compiler/Optimize.py
index 51dbd767f3ff04abd165aed2990233f9aea2ee69..ba50d824731e56c10fb33da320a43e3b237e3a6c 100644
(file)
--- a/
Cython/Compiler/Optimize.py
+++ b/
Cython/Compiler/Optimize.py
@@
-1051,6
+1051,10
@@
class OptimizeBuiltinCalls(Visitor.EnvTransform):
])
def _handle_simple_function_len(self, node, pos_args):
+ # note: this only works because we already replaced len() by
+ # PyObject_Length() which returns a Py_ssize_t instead of a
+ # Python object, so we can return a plain size_t instead
+ # without caring about Python object conversion etc.
if len(pos_args) != 1:
self._error_wrong_arg_count('len', node, pos_args, 1)
return node