From 0b14e4215485d59841a3fcd6bba42770de48ba86 Mon Sep 17 00:00:00 2001 From: Frederik Hennig <frederik.hennig@fau.de> Date: Tue, 27 Feb 2024 16:46:32 +0100 Subject: [PATCH] remove now-unnecessary functions --- mypy.ini | 6 ++--- src/pystencils/backend/functions.py | 42 ----------------------------- 2 files changed, 3 insertions(+), 45 deletions(-) diff --git a/mypy.ini b/mypy.ini index 75e6a5646..999a7e590 100644 --- a/mypy.ini +++ b/mypy.ini @@ -5,11 +5,11 @@ exclude = "src/pystencils/old" [mypy-pystencils.*] ignore_errors=true +[mypy-pystencils.backend.*] +ignore_errors = False + [mypy-setuptools.*] ignore_missing_imports=true [mypy-appdirs.*] ignore_missing_imports=true - -[mypy-pystencils.backend.*] -ignore_errors = False diff --git a/src/pystencils/backend/functions.py b/src/pystencils/backend/functions.py index bddb5ca1a..81c48d108 100644 --- a/src/pystencils/backend/functions.py +++ b/src/pystencils/backend/functions.py @@ -19,8 +19,6 @@ from typing import Any, TYPE_CHECKING from abc import ABC from enum import Enum -from .types import PsAbstractType - if TYPE_CHECKING: from .ast.expressions import PsExpression @@ -97,43 +95,3 @@ class PsMathFunction(PsFunction): @property def arg_count(self) -> int: return self._func.arg_count - - -class Deref(PsFunction): - """Dereferences a pointer.""" - - def __init__(self): - super().__init__("deref", 1) - - -deref = Deref() - - -class AddressOf(PsFunction): - """Take the address of an object""" - - def __init__(self): - super().__init__("address_of", 1) - - -address_of = AddressOf() - - -class Cast(PsFunction): - """An unsafe C-style type cast""" - - def __init__(self, target_type: PsAbstractType): - super().__init__("cast", 1) - self._target_type = target_type - - @property - def arg_count(self) -> int: - return 1 - - @property - def target_type(self) -> PsAbstractType: - return self._target_type - - -def cast(target_type: PsAbstractType, arg: PsExpression): - return Cast(target_type)(arg) -- GitLab