[Python-Dev] Need advice, maybe support

Thomas Heller theller@python.net
23 May 2003 17:31:06 +0200


> > > The other is the new style where the PyMethodDef
> > > array is in tp_methods, and is scanned once by PyType_Ready.
> > 
> > Right, again. Now, under the hopeful assumption that every
> > sensible extension module that has some types to publish also
> > does this through its module dictionary, I would have the
> > opportunity to cause PyType_Ready being called early enough
> > to modify the method table, before any of its methods is used
> > at all.
> 
> Dangerous assumption!  It's not inconceivable that a class would
> instantiate some of its own classes as part of its module
> initialization.

I do not really know what you are talking about here, but that
assumption is violated by the ctypes module.
It has a number of metaclasses implemented in C, neither of them
is exposed in the module dictionary, and there *have been* types which
were not exposed, because they are only used internally.

Thomas