[Python-Dev] Special-casing "O"

Thomas Wouters thomas@xs4all.net
Mon, 28 May 2001 00:50:58 +0200


On Sun, May 27, 2001 at 10:32:48PM +0100, Michael Hudson wrote:
> On Sun, 27 May 2001, Tim Peters wrote:

> > Next question:  why isn't builtin_len using METH_OLDARGS instead?  Is
> > there some advantage to using METH_VARARGS in this case?

> So you can't do

> >>> len(1,2)
> 2

> a la list.append, socket.connect pre 2.0?  (or was it 1.6?)

And don't forget the method-specific errormessage by passing ':len' in the
format string. Of course, this can easily be (and probably should) done by
passing another argument to whatever parses arguments in METH_O, rather than
invoking string parsing magic every call.

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!