Class methods in Python/C?

Craig Ringer craig at postnewspapers.com.au
Wed Dec 1 01:38:26 EST 2004


On Wed, 2004-12-01 at 00:15, Thomas Heller wrote:

> To answer the original question: To create class methods in C code, you
> use the METH_CLASS flag in the PyMethodDef structure.  Supported in
> Python 2.3 and above, in 2.2 it is more complicated.  If needed, I can
> post a snippet for 2.2 as well.

Thanks for that. I found the answer while composing my reply to a
previous post on this thread, before I saw yours (your message wasn't
threaded for some reason - odd, as it has a References: header).

I'm able to stick to Python 2.3 and above, so there's no need to worry
about older code. Thanks.

--
Craig Ringer




More information about the Python-list mailing list