Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving things for runtime and adding abstractmethod. #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Sep 18, 2024

  1. Improving things for runtime and adding abstractmethod.

    Added from abc import ABC, `abstractmethod`.
    
    This imports the necessary tools from Python's Abstract Base Class (ABC) module.
    
    Changed class `RadioDetector` to class `RadioDetector(ABC)`.
    
    Thus by inheriting from ABC, we explicitly declare this as an abstract base class. 
    
    This makes the intention clearer and provides better support for abstract methods.
    
    Replaced raise `NotImplementedError(...)` with `@abstractmethod` decorator.
    
    The `@abstractmethod` decorator is more idiomatic in Python for defining abstract methods. It prevents instantiation of any subclass that doesn't implement these methods, which is more robust than raising an error at runtime.
    Montana authored Sep 18, 2024
    Configuration menu
    Copy the full SHA
    b79c3ad View commit details
    Browse the repository at this point in the history