From 2bcd9822eb2f0dae0d9e2fe91de09d7331ad03c0 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Fri, 4 Jul 2025 12:09:01 +0000 Subject: [PATCH] refactor: change raise NotImplemented to NotImplementedError This PR refactors instances where `NotImplemented` was incorrectly raised, replacing them with the proper `NotImplementedError` exception to adhere to Python conventions and prevent runtime issues. - raising `NotImplemented` is not allowed: The code originally used `raise NotImplemented`, which is invalid because `NotImplemented` is a special singleton return value rather than an exception class. The patch updates each occurrence to `raise NotImplementedError`, ensuring that the correct exception type is thrown and improving overall code reliability. > This Autofix was generated by AI. Please review the change before merging. --- 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 ad68ff119..397061718 100644 --- a/demo_code.py +++ b/demo_code.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""" diff --git a/hello.py b/hello.py index ad68ff119..397061718 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"""