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

Return correct types for Question.ask #272

Open
alex-way opened this issue Apr 20, 2023 · 0 comments
Open

Return correct types for Question.ask #272

alex-way opened this issue Apr 20, 2023 · 0 comments
Labels
Enhancement New feature or request

Comments

@alex-way
Copy link

Describe the problem

Question.ask is typed as Any which makes me sad.

Describe the solution

I've not had a massive look through the codebase but the immediate solution seems to be turning Question into a generic so we can type the return Type:

class Question(Generic[T]):
    def ask(self) -> T
---
def checkbox(...) -> Question[list[str]]:
    ...

I'll see if I can provide a pull request.

Alternatives considered

No response

@alex-way alex-way added the Enhancement New feature or request label Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant