-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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: force type hint check with mypy #1780
Comments
we would definitely love to fully enable type checking, however, we understand it is fairly involved and time consuming so we are focusing on more pressing issue. if you can help contribute that would be amazing! |
@rkooo567 you may close this once you've completed the PR for cross-directory type checking with |
Yeah I will need to create 1 more PR to finish this |
This issue has been automatically marked as stale because it has not had any activity within 90 days. It will be automatically closed if no further activity occurs within 30 days. Leave a comment if you feel this issue should remain open. Thank you! |
Closing this as mypy has been enabled to some extent - please refer to #3680 for further developments. |
Why
While I am learning the source code, I found it challenging to understand asyncio. Taking this codebase as an example, I spend quite some time with the following method signature:
vllm/vllm/engine/async_llm_engine.py
Lines 394 to 399 in 7c60044
I realized there was a discrepancy in the return type hint. The original hint was:
However, the correct hint should be:
For a detailed demonstration of this issue, please see the appendix below.
Proposal
To enhance type checking with mypy, it's advisable to include the following options in mypy.ini, as suggested in this StackOverflow answer:
Appendix
Below is a complete example that illustrates the correct use of type hints for async iterators:
The text was updated successfully, but these errors were encountered: