Programming Python - examples from the book work, no?

Michael P. Reilly arcege at
Mon Jun 7 11:19:22 EDT 1999

Gordon McMillan <gmcm at> wrote:
: Thomas S. Strinnhed writes:
:> Doing everything in MSVC++ on NT I try to run the Example 14-2
:> (p534-540 ) from "Programming Python" by Mark Lutz. I run it just
:> like it comes on the CD included with the book
:> (CD-DRIVE:/Examples/DOS/Extend/Stacktyp.c) trying to extend Python
:> with this Stack-type. BUT: I get an I-don't-know-what-this-is-about
:> kind of compiler error, complaing about this call:
:> PyObject_HEAD_INIT(&PyType_Type)  with message "initializer is not a
:> constant".

: While every other C compiler on earth allows this, MS decided on a 
: very literal reading of the C language spec. The easiest way around 
: it is to change the extension on your file to .cpp. The "proper" way 
: around it is to define the type object with a NULL in this slot, and 
: then assign &PyType_Type to it after it has been created.

Ah.. thank you, Gordon.. I was wondering why that was there in _tkinter.c
when I was making mods. ;)


More information about the Python-list mailing list