On Sat, Jun 23, 2012 at 8:23 PM, gmspro <gms...@yahoo.com> wrote: > I'm trying to call this function, > http://hg.python.org/cpython/file/3b7230997425/Modules/arraymodule.c#l657 > > Is that possible to call that function? > > I know it's possible to do: > >>>len(arr)
You call it just like that. array_length is the C implementation of __len__ for arrays. > Doesn't it call this : > http://hg.python.org/cpython/file/c0eab397f098/Python/bltinmodule.c#l1283 > instead of this: > http://hg.python.org/cpython/file/3b7230997425/Modules/arraymodule.c#l657 Yes, and builtin_len calls PyObject_Size, which in turn calls the object's sq_length method, which is defined to be array_length for arrays. -- http://mail.python.org/mailman/listinfo/python-list