[Python-Dev] Special-casing "O"

Tim Peters tim.one@home.com
Sun, 27 May 2001 16:46:29 -0400


[Tim, thrashing]
> ...
> So it's clearly expecting a tuple.  But its entry in the builtin_methods[]
> table is:
>
> 	{"len",		builtin_len, 1, len_doc},
>
> That is, it says nothing about the calling convention.

Oops, it does, using a hardcoded 1 instead of the METH_VARARGS #define.  So
that explains that.

Next question:  why isn't builtin_len using METH_OLDARGS instead?  Is there
some advantage to using METH_VARARGS in this case?  This gets back to what
these #defines are intended to *mean*, and I still haven't figured that out.