MCPcopy Create free account
hub / github.com/numpy/numpy / __init__

Method __init__

numpy/core/code_generators/genapi.py:404–423  ·  view source on GitHub ↗
(self, name, index, annotations, return_type, args, api_name)

Source from the content-addressed store, hash-verified

402
403class FunctionApi:
404 def __init__(self, name, index, annotations, return_type, args, api_name):
405 self.name = name
406 self.index = index
407
408 self.min_version = None
409 self.annotations = []
410 for annotation in annotations:
411 # String checks, because manual import breaks isinstance
412 if type(annotation).__name__ == "StealRef":
413 self.annotations.append(annotation)
414 elif type(annotation).__name__ == "MinVersion":
415 if self.min_version is not None:
416 raise ValueError("Two minimum versions specified!")
417 self.min_version = annotation
418 else:
419 raise ValueError(f"unknown annotation {annotation}")
420
421 self.return_type = return_type
422 self.args = args
423 self.api_name = api_name
424
425 def _argtypes_string(self):
426 if not self.args:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected