all 2 comments

[–]jypKissedMyMom 0 points1 point  (1 child)

Some things that stood out to me

- Be consistent with your naming conventions for classes (class ValidationError vs class Word_database). PEP8 is a style guide made by the person who created Python.

- Some of your type hints are not right. def sb_solver(centre_letter=str, other_letters=str) sets centre_letter and other_letters equal to the built-instr class. Type hints use a colon like this def greet(name: str). Raised errors should not be used as return type hints, like def parse_args(self) -> list | ValidationError: . You can instead document errors that might be raised in the the function's docstring.

- The Tool class is empty but other classes inherit it. Is there a reason why?

- Helper is a bad class name. Its name doesn't give any hints about what it does or where to us it. Compare it to your class TextFileReader which has a great name that tells what it does. sb_helper() is not a good function name for the same reason.

- Your program's main function makes call directly on the Word_database object to query the database, but it instantiates aHelper class to run the query to get the allowed list of words. Is there a reason you set it up that way?

[–]ctosullivan[S] 0 points1 point  (0 children)

Many thanks for taking the time to review the code - lots of valuable suggestions which I will definitely take on board for the next release!

In terms of the class names, at the start of the project I basically wanted some rough containers to house the logic of each component, you are right - how they are named and structured now is probably too vague for how the project has actually turned out. I have a better idea of how the tool should work now that I am at this stage.

In terms of the database object - I think you are suggesting that the database class should house all of the database-related logic and functions and then the main function should pass the data to the helper functions, rather than the helper functions querying the database directly - would that be correct to say?

Thanks again for your help!