From 83b7c8ccfa30f00c911496f3244ca1c5536ef411 Mon Sep 17 00:00:00 2001 From: Stephan Seitz <stephan.seitz@fau.de> Date: Fri, 27 Sep 2019 15:59:13 +0200 Subject: [PATCH] Bugfix: Pystencils printed `const` twice on assignments to const numpy.dtypes Pystencils will print two const when printing an assignment to a const numpy.dtype. With the new type interference, this case can now occur more often --- pystencils/backends/cbackend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pystencils/backends/cbackend.py b/pystencils/backends/cbackend.py index 9f454168..a50f00b2 100644 --- a/pystencils/backends/cbackend.py +++ b/pystencils/backends/cbackend.py @@ -229,7 +229,7 @@ class CBackend: prefix = 'const ' else: prefix = '' - data_type = prefix + self._print(node.lhs.dtype) + " " + data_type = prefix + self._print(node.lhs.dtype).replace(' const', '') + " " return "%s%s = %s;" % (data_type, self.sympy_printer.doprint(node.lhs), self.sympy_printer.doprint(node.rhs)) else: -- GitLab