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

[PROPOSAL] Correct type hints or stub? #885

Open
skokado opened this issue Jan 15, 2025 · 1 comment
Open

[PROPOSAL] Correct type hints or stub? #885

skokado opened this issue Jan 15, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@skokado
Copy link

skokado commented Jan 15, 2025

Hi, Thank you for this great project

What/Why

What are you proposing?

Add or improve type hints more and more in this library.

What problems are you trying to solve?

There is something I notice when using this library.

The type hint Any is used everywhere in this project.
For example, it is clear that the Document.search() method returns a Search instance.

def search(cls, using: Any = None, index: Any = None) -> Any:

What is the user experience going to be?

This makes the library interface clearer and contributes to improved usability.
In particular, it has benefit when using high-level APIs.

What will it take to execute?

All we have to do is write the correct type hints for every function and method.
It does not affect the behavior of this library.

Are you maintainers in favor of improving the type hints? Or do you prefer separate stubs? (Just like django-stubs)

@github-actions github-actions bot added the untriaged Need triage label Jan 15, 2025
@dblock
Copy link
Member

dblock commented Jan 15, 2025

Yes, please, definitely in favor! Much of this code is generated so that's where I'd make most changes.

@dblock dblock added enhancement New feature or request and removed untriaged Need triage labels Jan 15, 2025
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

2 participants