Skip to content
Snippets Groups Projects

Sane Defaults for CreateKernelConfig

Merged Markus Holzer requested to merge holzer/pystencils:sanedefaults into master
Files
2
+ 10
1
@@ -120,7 +120,10 @@ class BasicType(AbstractType):
@@ -120,7 +120,10 @@ class BasicType(AbstractType):
return f'{self.c_name}{" const" if self.const else ""}'
return f'{self.c_name}{" const" if self.const else ""}'
def __repr__(self):
def __repr__(self):
return str(self)
return f'BasicType( {str(self)} )'
 
 
def _repr_html_(self):
 
return f'BasicType( {str(self)} )'
def __eq__(self, other):
def __eq__(self, other):
return self.dtype_eq(other) and self.const == other.const
return self.dtype_eq(other) and self.const == other.const
@@ -216,6 +219,9 @@ class PointerType(AbstractType):
@@ -216,6 +219,9 @@ class PointerType(AbstractType):
def __repr__(self):
def __repr__(self):
return str(self)
return str(self)
 
def _repr_html_(self):
 
return str(self)
 
def __hash__(self):
def __hash__(self):
return hash((self._base_type, self.const, self.restrict))
return hash((self._base_type, self.const, self.restrict))
@@ -273,6 +279,9 @@ class StructType(AbstractType):
@@ -273,6 +279,9 @@ class StructType(AbstractType):
def __repr__(self):
def __repr__(self):
return str(self)
return str(self)
 
def _repr_html_(self):
 
return str(self)
 
def __hash__(self):
def __hash__(self):
return hash((self.numpy_dtype, self.const))
return hash((self.numpy_dtype, self.const))
Loading