Description of a ufunc. Attributes ---------- nin : number of input arguments nout : number of output arguments identity : identity element for a two-argument function (like Zero) docstring : docstring for the ufunc typereso: type resolver function of type PyUFunc_TypeRe
| 191 | return tds |
| 192 | |
| 193 | class Ufunc: |
| 194 | """Description of a ufunc. |
| 195 | |
| 196 | Attributes |
| 197 | ---------- |
| 198 | nin : number of input arguments |
| 199 | nout : number of output arguments |
| 200 | identity : identity element for a two-argument function (like Zero) |
| 201 | docstring : docstring for the ufunc |
| 202 | typereso: type resolver function of type PyUFunc_TypeResolutionFunc |
| 203 | type_descriptions : TypeDescription objects |
| 204 | signature: a generalized ufunc signature (like for matmul) |
| 205 | indexed: add indexed loops (ufunc.at) for these type characters |
| 206 | no_float_errors: if True, the ufunc never raises floating point errors |
| 207 | """ |
| 208 | def __init__(self, nin, nout, identity, docstring, typereso, |
| 209 | *type_descriptions, signature=None, indexed='', |
| 210 | no_float_errors=False): |
| 211 | self.nin = nin |
| 212 | self.nout = nout |
| 213 | if identity is None: |
| 214 | identity = None_ |
| 215 | self.identity = identity |
| 216 | self.docstring = docstring |
| 217 | self.typereso = typereso |
| 218 | self.type_descriptions = [] |
| 219 | self.signature = signature |
| 220 | self.indexed = indexed |
| 221 | self.no_float_errors = no_float_errors |
| 222 | for td in type_descriptions: |
| 223 | self.type_descriptions.extend(td) |
| 224 | for td in self.type_descriptions: |
| 225 | td.finish_signature(self.nin, self.nout) |
| 226 | |
| 227 | check_td_order(self.type_descriptions) |
| 228 | |
| 229 | |
| 230 | # String-handling utilities to avoid locale-dependence. |
no outgoing calls
no test coverage detected
searching dependent graphs…