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

Make the base objects of Crappy children of abc.ABC #74

Open
WeisLeDocto opened this issue Nov 21, 2023 · 0 comments
Open

Make the base objects of Crappy children of abc.ABC #74

WeisLeDocto opened this issue Nov 21, 2023 · 0 comments
Assignees

Comments

@WeisLeDocto
Copy link
Member

In the very early days of Crappy, some methods were decorated with abc.abstractmethod to clearly signal that they were meant to be overwritten in subclasses. Since then, the decorators were removed (e.g. a72afa1) and it is now possible to instantiate the base classes or their children without redefining the main methods.

It would be nice to prevent the instantiation of the base classes, as they are anyway not usable as is to achieve anything. Their main methods (like the loop method of Block) should also be protected with an abc.abstractmethod decorator, to make sure they are redefined in children classes.

The target objects to refactor will be the Block, Actuator, Camera, InOut, Modifier, Path, CameraProcess, and Overlay. These classes will inherit from abc.ABC, and define at least one abc.abstractmethod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

1 participant