From d6275e0099f463517188620634161a2104f8c553 Mon Sep 17 00:00:00 2001 From: fazledyn-or Date: Thu, 16 Nov 2023 14:46:11 +0600 Subject: [PATCH 1/2] Replaced `NotImplementedError` with `NotImplemented` Signed-off-by: fazledyn-or --- mapcss/mapcss_lib.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mapcss/mapcss_lib.py b/mapcss/mapcss_lib.py index 2af94410a..92eb0e49f 100644 --- a/mapcss/mapcss_lib.py +++ b/mapcss/mapcss_lib.py @@ -59,7 +59,7 @@ def __rsub__(self, o): elif o.__class__ == int: return str_value(o - self.to_n()) else: - raise NotImplementedError + return NotImplemented def __sub__(self, o): if self.none: @@ -67,7 +67,7 @@ def __sub__(self, o): elif o.__class__ == int: return str_value(self.to_n() - o) else: - raise NotImplementedError + return NotImplemented def __rmul__(self, o): if self.none: @@ -75,7 +75,7 @@ def __rmul__(self, o): elif o.__class__ == int: return str_value(o * self.to_n()) else: - raise NotImplementedError + return NotImplemented def __mul__(self, o): if self.none: @@ -83,7 +83,7 @@ def __mul__(self, o): elif o.__class__ == int: return str_value(self.to_n() * o) else: - raise NotImplementedError + return NotImplemented def __rdiv__(self, o): if self.none: @@ -91,7 +91,7 @@ def __rdiv__(self, o): elif o.__class__ == int: return str_value(float(o) / self.to_n()) else: - raise NotImplementedError + return NotImplemented def __truediv__(self, o): if self.none: @@ -99,7 +99,7 @@ def __truediv__(self, o): elif o.__class__ == int: return str_value(float(self.to_n()) / o) else: - raise NotImplementedError + return NotImplemented def __lt__(self, o): if self.none: From 431bbd558ef10183cd099a0745e185bed4d133a6 Mon Sep 17 00:00:00 2001 From: fazledyn-or Date: Tue, 21 Nov 2023 11:19:00 +0600 Subject: [PATCH 2/2] Renaming `__rdiv__` to `__rtruediv__` for Python 3 Signed-off-by: fazledyn-or --- mapcss/mapcss_lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mapcss/mapcss_lib.py b/mapcss/mapcss_lib.py index 92eb0e49f..a747e069f 100644 --- a/mapcss/mapcss_lib.py +++ b/mapcss/mapcss_lib.py @@ -85,7 +85,7 @@ def __mul__(self, o): else: return NotImplemented - def __rdiv__(self, o): + def __rtruediv__(self, o): if self.none: return None_value elif o.__class__ == int: