Exemple #1
0
    def __init__(self, nargs, dispatchers):
        from numba.core.typing.templates import Signature
        signature = Signature(types.undefined, (types.undefined, ) * nargs,
                              recvr=None)

        super(UndefinedFunctionType, self).__init__(signature)

        self.dispatchers = dispatchers

        # make the undefined function type instance unique
        type(self)._counter += 1
        self._key += str(type(self)._counter)
Exemple #2
0
 def __call__(self, *args, **kwargs):
     if kwargs:
         raise TypingError("List() takes no keyword arguments")
     elif args:
         if not 0 <= len(args) <= 1:
             raise TypingError(
                 "List() expected at most 1 argument, got {}".format(
                     len(args)))
         rt = types.ListType(_guess_dtype(args[0]))
         self.attach_sig()
         return Signature(rt, args, None, pysig=self.pysig)
     else:
         item_type = types.undefined
         return types.ListType(item_type)