From: Stefan Behnel Date: Thu, 26 Nov 2009 19:51:20 +0000 (+0100) Subject: comment X-Git-Tag: 0.12.1~119^2~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=367bcd7929b20a38be096d30e4fff49267fea3f8;p=cython.git comment --- diff --git a/Cython/Compiler/Optimize.py b/Cython/Compiler/Optimize.py index 51dbd767..ba50d824 100644 --- 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