From 56d1dae5f28f34e37776728abeb992d2d243aaed Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Tue, 27 May 2025 10:10:08 +0000 Subject: [PATCH] refactor: replace NotImplemented raises with NotImplementedError **Fixes are generated by AI. Review them carefully before applying to your codebase.** This PR updates the code to replace any instances where `NotImplemented` was being raised with the appropriate `NotImplementedError` exception. This change aligns the codebase with Python best practices and ensures that error handling is semantically correct. - raising `NotImplemented` is not allowed: previously, some functions were using `raise NotImplemented`, which is not a valid exception in Python. We have replaced those occurrences with `raise NotImplementedError` to correctly signal unimplemented functionality and improve exception clarity. --- demo_code.py | 2 +- hello.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/demo_code.py b/demo_code.py index 9fde50644..539fc27db 100644 --- a/demo_code.py +++ b/demo_code.py @@ -16,7 +16,7 @@ def __init__(self): self.limits = (1, 10) def get_number(self, min_max): - raise NotImplemented + raise NotImplementedError def smethod(): """static method-to-be""" diff --git a/hello.py b/hello.py index dc8227b07..771e2fe00 100644 --- a/hello.py +++ b/hello.py @@ -17,7 +17,7 @@ def __init__(self): self.limits = (1, 10) def get_number(self, min_max): - raise NotImplemented + raise NotImplementedError def smethod(): """static method-to-be"""