[Python-Dev] argument parsing (was: just say no...)

Mark Hammond mhammond@skippinet.com.au
Sat, 13 Nov 1999 23:52:18 +1100


[Lamenting about PyArg_ParseTuple and managing memory buffers for
String/Unicode conversions.]

So what is really wrong with Marc's proposal about the extra pointer
on the Unicode object?  And to double the carnage, who not add the
equivilent native Unicode buffer to the PyString object?

These would only ever be filled when requested by the conversion
routines.  They have no other effect than their memory is managed by
the object itself; simply a convenience to avoid having extension
modules manage the conversion buffers.

The only overheads appear to be:
* The conversion buffers may be slightly (or much :-) longer-lived -
ie, they are not freed until the object itself is freed.
* String object slightly bigger, and slightly slower to destroy.

It appears to solve the problems, and the cost doesnt seem too high...

Mark.