[Bf-python] Bug fix in Type objects

Michel Selten michel.s at home.nl
Mon Jun 2 22:18:01 CEST 2003


Hi,

due to compilation errors on Windows, I had to fix all PyTypeObject
structs. The suggestion was done by Aphex (Simon Clitherow).

Now it should compile, but it made me wonder if the fix is actually
working. I have not yet tested it. Here's why I'm a bit sceptical:

The xxxxx.ob_type field gets &PyType_Type assigned at initialisation.
The function xxxxx_CheckPyObject compares the ob_type field with the
actual xxxxx type. The xxxx type != PyType_Type. Therefore I think the
CheckPyObject will always return false.
However, checking the code in bpython makes me wonder if it actually
should work. There it's done at multiple places in the exact same way.

I guess one way to find out is to test it :) Let's do that tomorrow.
You may see an update in cvs tomorrow again if the update indeed was
faulty. In that case, I'm sorry for committing something that still
doesn't work - but compiles on more systems :)

Note that I have to do the initialisation of ob_type in the M_xxx_Init
functions. Not all modules have those functions. In those modules, I
added the statement to the function that made the most sense IMO. Feel
free to change it.

With regards,
	Michel




More information about the Bf-python mailing list