[mod_python] quick code review

Greg Stein gstein at lyra.org
Fri May 26 00:54:31 EST 2000


On Thu, 25 May 2000, Gregory Trubetskoy wrote:
>...
> On Thu, 25 May 2000, Greg Stein wrote:
> > *) I don't understand why the PyTypeObject's are init'd/copied in
> >    python_init, rather than just doing that at the module level. For
> >    example:
> >      static PyTypeObject serverobjecttype = { ... };
> 
> I wonder if this is something that I had to do back in httpdapy times so
> that it compiled on Visual C++...?

There is something about static initializers in MSVC. Generally, code will
add a line such as:

(from arraymodule.c)

    Arraytype.ob_type = &PyType_Type;


I don't know exactly *why* it must be done that way, but there ya go. The
underlying point is that the initialization of the type objects can be
simplified quite a bit.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

_______________________________________________
Mod_python mailing list
Mod_python at modpython.org
http://www.modpython.org/mailman/listinfo/mod_python



More information about the Mod_python mailing list