-
Notifications
You must be signed in to change notification settings - Fork 238
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
Python: generate type stubs for all user functions #1506
Conversation
feb0ff4
to
14f274a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but it might make sense to update that comment?
1c737ed
to
835fc4b
Compare
What's the status of this? The changes seem approved. Does it only need a rebase? (Is help with the rebase wanted?) |
Ah yes, this once again needs a rebase. It fell through a bit due to other work, but I can take this up today. |
1. Methods of a callback expect `self` as the first argument (instance methods) 2. `contextlib.contextmanager`-methods require _some_ args (according to `mypy`), so we use a catchall (where nothing is fine too)
04ee66a
to
b4aa69c
Compare
After getting asked about it the other day on reddit I figured I give it a go.
Turns out generating the right types in Python is possible and pleases mypy when used in Glean as well (for the most part).
There's some not-yet fixed cases, I want to add some testing and ensure this reliably works, so marking this as WIP for the moment.