[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.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4