def simple_type(self): # If the operator is a simple type return then the App of # it is also has simple_type, or it raises NotSimple. ty = self.operator.simple_type() if coretypes.is_simple(ty): return ty else: raise NotSimple()
def simple_type(self): """ If possible determine the datashape before we even hit eval(). This is possible only for simple types. Possible:: 2, 2, int32 Example Not Possible:: X, 2, int32 """ # Get the the simple types for each of the operands. if not all(coretypes.is_simple(op.simple_type()) for op in self.operands if op is not None): raise NotSimple() else: return coretypes.promote(*self.operands)
def simple_type(self): """ If possible determine the datashape before we even hit eval(). This is possible only for simple types. Possible:: 2, 2, int32 Example Not Possible:: X, 2, int32 """ # Get the the simple types for each of the operands. if not all( coretypes.is_simple(op.simple_type()) for op in self.operands if op is not None): raise NotSimple() else: return coretypes.promote(*self.operands)