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

Generate typehint for all the functions #262

Open
BoxiLi opened this issue Jan 12, 2025 · 0 comments
Open

Generate typehint for all the functions #262

BoxiLi opened this issue Jan 12, 2025 · 0 comments

Comments

@BoxiLi
Copy link
Member

BoxiLi commented Jan 12, 2025

Currently, not all functions and classes in the codebase have type hints. In #255 and #256, I used an LLM to generate type hints, but the process was inefficient and cumbersome, as it required feeding each function individually (at least at that time, it does not handle long code very well). This approach makes it challenging to regenerate or update type hints when changes occur.

To improve this:

  • It would be nice to have them automatically generated. We should use the modern syntax such as int | list[int] | None, as suggested in Add type hints to the circuit module #255. @gadhvirushiraj found MonkeyType, which will generate type hints based on the testing code.
  • Those type hints added always need some post-processing. And we may find some small bugs while handling them. Therefore it is best to do this module by module, allowing for manageable PRs and manual adjustments.
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

No branches or pull requests

1 participant