From e5700eb414ce4e6f2d1548c183a6a237c987b7e8 Mon Sep 17 00:00:00 2001 From: Stephan Seitz <stephan.seitz@fau.de> Date: Fri, 12 Jul 2019 17:05:35 +0200 Subject: [PATCH] Add `get_dummy_symbol` --- pystencils/astnodes.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pystencils/astnodes.py b/pystencils/astnodes.py index 2d3174a1a..c0472f984 100644 --- a/pystencils/astnodes.py +++ b/pystencils/astnodes.py @@ -1,3 +1,4 @@ +import uuid from typing import Any, List, Optional, Sequence, Set, Union import jinja2 @@ -700,3 +701,7 @@ class DestructuringBindingsForFieldClass(Node): def atoms(self, arg_type) -> Set[Any]: return self.body.atoms(arg_type) | {s for s in self.symbols_defined if isinstance(s, arg_type)} + + +def get_dummy_symbol(dtype='bool'): + return TypedSymbol('dummy%s' % uuid.uuid4().hex, create_type(dtype)) -- GitLab