Exemplo n.º 1
0
Arquivo: types.py Projeto: tpn/numba
 def __init__(self, name, bases, dict):
     if dict.get('typename') is None and name[0].islower():
         self.typename = name.rstrip("_")
     if self.typename is not None:
         register(self.typename, self)
     _update_class(self)
     self.conser = Conser(partial(type.__call__, self))
Exemplo n.º 2
0
Arquivo: types.py Projeto: ASPP/numba
 def __init__(self, name, bases, dict):
     if dict.get('typename') is None and name[0].islower():
         self.typename = name.rstrip("_")
     if self.typename is not None:
         register(self.typename, self)
     _update_class(self)
     self.conser = Conser(partial(type.__call__, self))
Exemplo n.º 3
0
Arquivo: types.py Projeto: tpn/numba
class TypeMetaClass(type):
    "Metaclass for numba types, conses immutable types."

    def __init__(self, name, bases, dict):
        if dict.get('typename') is None and name[0].islower():
            self.typename = name.rstrip("_")
        if self.typename is not None:
            register(self.typename, self)
        _update_class(self)
        self.conser = Conser(partial(type.__call__, self))

    def __call__(self, *args, **kwds):
        args = self.default_args(args, kwds)
        if not self.mutable:
            return self.conser.get(*args)
        return type.__call__(self, *args)
Exemplo n.º 4
0
Arquivo: types.py Projeto: ASPP/numba
class TypeMetaClass(type):
    "Metaclass for numba types, conses immutable types."

    def __init__(self, name, bases, dict):
        if dict.get('typename') is None and name[0].islower():
            self.typename = name.rstrip("_")
        if self.typename is not None:
            register(self.typename, self)
        _update_class(self)
        self.conser = Conser(partial(type.__call__, self))

    def __call__(self, *args, **kwds):
        args = self.default_args(args, kwds)
        if not self.mutable:
            return self.conser.get(*args)
        return type.__call__(self, *args)