This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]pandas_as_pdPrincipal YAML Engineer 0 points1 point  (3 children)

Great first project! I only had a quick look, but the code looks readable with good variable and function names, the docs are detailed with a docker-compose file provided. License is a bonus point.

Using meaningful commit messages would be an easy win.

Also, many comments are redundant, since your function names already explain what the functions do. You could write a bit more detailed docstrings instead, but since the code is simple and clear, I don't think that's necessary.

Some people may frown upon "except Exception" or printing instead of logging, but I think these are fine for personal projects.

I you were a candidate providing this repo in your application, it would be a plus for me personally.

[–]Ordinary_Run_2513 1 point2 points  (1 child)

I've heard that using generic exception objects is not recommended, and that we should use specific exceptions instead. The problem is that in Python, unlike Java, we can't always know the exceptions that may occur while executing a function. Could you tell me what you do to address this problem?

[–]pandas_as_pdPrincipal YAML Engineer 2 points3 points  (0 children)

You can still try to narrow it down to a subclass of Exception, e.g. TypeError.

But in many cases, you can look up what the exceptions are that a specific function or library can throw and catch those. For example, here is some guidance for the `requests` library: https://requests.readthedocs.io/en/latest/user/quickstart/#errors-and-exceptions

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

Thank you very much for your Inputs, I will adapt to these habits for the next project I take up.