def __init__(self, namespace, fn, mappers=(), failsilently=True, usedefaults=True): super(Func, self).__init__() self.shape_constraints = {} self.ns = namespace self.fn = fn self.mappers = list(mappers) if usedefaults: self.mappers = self.mappers + list(self.default_mappers) self.mangled_name = fn.mangled if fn.mangled else fn.name self.name = fn.name self.valid_types = True self.failsilently = failsilently self.reason = None self.restype = self.parseType('__retval', fn.return_type, getattrs(fn)) self.argtypes = map(self.parseArg, fn.arguments)
def parseArg(self, pgxarg): return self.parseType(pgxarg.name, pgxarg.type, getattrs(pgxarg))