c.evans at clear.net.nz
Wed Sep 20 12:36:45 CEST 2000
kc5tja at garnet.armored.net (Samuel A. Falvo II) writes:
> The problem is I want to make a new "type" under Python. How the bloody
> heck do I do this in C? I've got tutorials that indicates how to make a
> Python extension, but not an extension *type* (that is, the ability to
> instantiate an object with methods).
It's probably worth having a look at the Python source itself,
especially the source in Objects. This is where the standard
Python types are defined.
Complete modules with all the proper initialisation code as well are
under Modules, like md5module.c. Also in there is xxmodule.c, which
is a template for you to fill in the gaps.
And have a look at Tools/modulator, which will generate your initial C
source for you from a graphical interface.
Carey Evans http://home.clear.net.nz/pages/c.evans/
"As I understand it, gnus is emacs. Thus gnus is Evil Incarnate."
- Jasper Janssen
More information about the Python-list