From 367bcd7929b20a38be096d30e4fff49267fea3f8 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 26 Nov 2009 20:51:20 +0100 Subject: [PATCH] comment --- Cython/Compiler/Optimize.py | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.26.2