Lisandro Dalcin wrote: > static PyTypeObject *__pyx_ptype_3foo_Foo; > #define PyFoo_Type (*__pyx_ptype_3foo_Foo)
That's an implementation detail. The #define is there so that the same code can be generated to refer to the type object whether it's statically declared in the same module or imported from another module. There's no need for the #define in the case of a function, because C automatically dereferences a function pointer if you try to call it. Having the function name #defined to a mangled name would do no good, because if the name it's exported under is going to clash with anything, the #defined name would clash in the same way. When you export an api for a C function, you're putting its name in the C global namespace, and it's your responsibility to ensure that it doesn't clash with anything. -- Greg _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
