comment
authorStefan Behnel <scoder@users.berlios.de>
Thu, 26 Nov 2009 19:51:20 +0000 (20:51 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Thu, 26 Nov 2009 19:51:20 +0000 (20:51 +0100)
Cython/Compiler/Optimize.py

index 51dbd767f3ff04abd165aed2990233f9aea2ee69..ba50d824731e56c10fb33da320a43e3b237e3a6c 100644 (file)
@@ -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