So I did a project in python to see if I can code I'd like to have feedback about code quality and design https://github.com/fraqve/Aegis-scan
#๐ Feedback for my beginner project
13 messages ยท Page 1 of 1 (latest)
@distant viper
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
there's no package structure or a packaging manifest
@distant viper
return type annotations are missing
the exception catching seems a bit too broad
data["error"] = f"Error:{response.status_code}" <- why include the "Error" text here? isn't that obvious from the fact that it's inside the error key?
We kinda need what's the type of error
What's return type annotaions
Note that this is my first real project I'm not an expert also thanks for the feedback
it's type hinting for the data that a function/method returns, like None here below
def pretty_print(json: Collection) -> None:
...
```just like you type hint your parameters in the signature of your functions
I think they mean you could have data["error"] = response.status_code when it's clear that data["error"] is an error strictly based on response.status_code
another thing you could do is start using modern dependency and project management by using pyproject.toml instead of requirements.txt
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.