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

Type hints in cli modules #84

Closed

Conversation

mooncrosser
Copy link

Abstract

#81 point 7

Adding type hints in CLI module

Action Taken

I've added type hints in the CLI module, I think I got most of them correct but review carefully. With this change, mypy shows 140+ errors, so there's a bunch of refactoring to be done.

Copy link
Collaborator

@pm5k pm5k left a comment

Choose a reason for hiding this comment

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

You're going to hate me, but in terms of using anything from typing the common practice is to import each item individually, rather than importing typing and then using typing.TYPE in signatures.

I.E:

from typing import (Any, Callable, Union, ..)

def something(func: Callable[..., str], something: Union[str, int]) -> str:
    pass

The main reason for it is because we don't wanna bloat the actual code, and imports won't actually bloat that much, because frankly - how many different types do we normally use, right?

Please can I ask you to amend the commits to align with this?

@pm5k
Copy link
Collaborator

pm5k commented Dec 12, 2022

OOS & OOD

@pm5k pm5k closed this Dec 12, 2022
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