C API eqivalent of object.__new__
Alex Martelli
aleaxit at yahoo.com
Fri Oct 1 12:12:51 EDT 2004
Jacek Generowicz <jacek.generowicz at cern.ch> wrote:
...
> I was indeed starting to think about PyObject_Call* approaches to
> this, but didn't want to go down that path without making sure that I
> haven't missed some function that was specifically designed to do it.
>
> If _you_ don't know of one, then I'll take that to mean that I
> shouldn't waste more time looking for it :-)
>
> Thanks.
You're welcome, but wrong (even though very kind!-) in assuming I
necessarily know every nook and cranny of Python's C API -- more often
than not, I focus on getting the job done, which means using the easiest
way (generally PyObject_somethingorother), then possibly go back looking
for potential acceleration, if and only if I need to optimize. "Make it
work, make it right, make it fast", as Kent Beck says!-). I've never
needed to optimize this specific case, so I wouldn't be surprised to
learn about better and faster approaches...
Alex
More information about the Python-list
mailing list