[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Py C/API - Using METH_O vs METH_VARARGS



Campbell Barton wrote:
On Fri, Dec 12, 2008 at 10:42 AM, Lenard Lindstrom <len-l@xxxxxxxxx> wrote:
Hi Cambell,

Thanks for the suggestion. It would simplify some code. Though I can't speak
for the other Pygame developers, I believe on proposed change is to make all
Pygame functions accept keyword arguments. Some functions already do, so
maybe they all should to be consistent.

Lenard

Campbell Barton wrote:
Noticed METH_O isnt used anywhere in pygame, this avoids creating a
tuple only to get a single PyObject back out with PyArg_ParseTuple().


--
Lenard Lindstrom
<len-l@xxxxxxxxx>



Hey Lenard & PyGamers

Re: Using Keywords,
if you read Python 2.x-3.0 source youll see they dont use keywords for
everything (use METH_O in many places too).
This seems a bit overkill for single argument functions to me, and
wont make the api any easier to use?

Id be interested to know what the perceived advantages are for this.
Probably no advantage using keywords for single argument functions. The switch to METH_O can be done as other functions are upgraded.

--
Lenard Lindstrom
<len-l@xxxxxxxxx>