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

Need type hints for decorator return types #49

Open
vectro opened this issue Jan 25, 2023 · 2 comments
Open

Need type hints for decorator return types #49

vectro opened this issue Jan 25, 2023 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@vectro
Copy link

vectro commented Jan 25, 2023

Because optgroup.group and optgroup.option do not have hints on their return types. mypy generates errors at the call site like Untyped decorator makes function "cli" untyped.

I think this could be resolved by adding type hints on the return values of these functions, as described in the mypy documentation.

@espdev espdev added the help wanted Extra attention is needed label Feb 4, 2023
@LecrisUT
Copy link
Contributor

The documentation of how to type-check decorators is rather vague, especially in order to add optional arguments. If there is any example that would help.

@tecknicaltom
Copy link

with the addition of the Decorator definition added in a468470 this should be fixable by adding the return type annotation -> Decorator to _OptGroup.group

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants