def wrappped(func): module = inspect.getmodule(func).__name__ signature = sigutils.parse_signature(sig) entry = ExportEntry(symbol=sym, signature=signature, function=func, module=module) registry.append(entry)
def export(self, exported_name, sig): sig = sigutils.parse_signature(sig) if exported_name in self._exported_functions: raise KeyError("duplicated export symbol %s" % (exported_name)) def decorator(func): entry = ExportEntry(exported_name, sig, func) self._exported_functions[exported_name] = entry return func return decorator
def export(self, exported_name, sig): """ Mark a function for exporting in the extension module. """ sig = sigutils.parse_signature(sig) if exported_name in self._exported_functions: raise KeyError("duplicated export symbol %s" % (exported_name)) def decorator(func): entry = ExportEntry(exported_name, sig, func) self._exported_functions[exported_name] = entry return func return decorator