Module.add_typedef API, implemented only for C++ classes/structs for now.
This commit is contained in:
1 parent
f26ed63f39
commit
f3a0c9a33c
6 files changed
+63
-1
No files matched your search
@@ -1652,6 +1652,16 @@ static void
|
||||
|
||||
return tp_richcompare_function_name
|
||||
|
||||
def generate_typedef(self, module, alias):
|
||||
"""
|
||||
Generates the appropriate Module code to register the class
|
||||
with a new name in that module (typedef alias).
|
||||
"""
|
||||
module.after_init.write_code(
|
||||
'PyModule_AddObject(m, \"%s\", (PyObject *) &%s);' % (
|
||||
alias, self.pytypestruct))
|
||||
|
||||
|
||||
###
|
||||
### ------------ C++ class parameter type handlers ------------
|
||||
###
|
||||
|
||||
Reference in new issue
Block a user