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

Add type hints to make objects easier to track during development. #131

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

Conversation

snowskeleton
Copy link
Contributor

The only changes in this commit are to method and function signatures. I was frustrated that I couldn't trace things properly, so I added hints for EVERYTHING (mostly).

I tried to sort the imports like you had the others sorted, but lemme know if I miss-ordered anything.

@mkb79
Copy link
Owner

mkb79 commented Dec 1, 2022

Thank you for your PR. I will take a look on this now.

@@ -143,7 +143,7 @@ class LibraryItem(BaseItem):
def _prepare_data(self, data: dict) -> dict:
return data.get("item", data)

def _get_codec(self, quality: str):
def _get_codec(self, quality: str) -> tuple[str | None, int | None]:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is incorrect notation. without a lot of rejiggering, safest would just to have it noted as -> tuple:

@@ -126,5 +126,5 @@ def invoke(self, ctx):
click.echo(self.help, color=ctx.color)
ctx.exit(1)

def parse_args(self, ctx, args):
def parse_args(self, ctx: None, args: list[str]):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same issue here as above. can't use brackets with builtin methods

@mkb79
Copy link
Owner

mkb79 commented Dec 2, 2022

Hi. Currently I'm working on a fullstack Django/React app for Audible. So I'm short on time. But will give my best to merge your pr after a review.

@snowskeleton
Copy link
Contributor Author

All good. my last two comments were mostly reminders to myself.

The django/react app sounds cool! I'm eager to check it out once you have it working

@mkb79
Copy link
Owner

mkb79 commented Dec 2, 2022

The django/react app sounds cool! I'm eager to check it out once you have it working

I will invite you to this project when it's ready for beta testing ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants