-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add stub file #108
base: master
Are you sure you want to change the base?
Add stub file #108
Conversation
I'm also looking forward for type hints. Is extra work needed here, if yes, I can help. |
@mwilliamson, sorry for the ping. If you prefer to not have them included in the repository itself, I'll open a PR on typeshed instead :) |
I like the idea in principle of having stub files, but I think it'd be good to make sure they're kept in sync with the actual code, for instance by:
I'm not sure what other Cython projects typically do? If the stub is maintained by hand, then I think it's probably worth hiding internal details such as Just to be clear: the above is meant as thoughts for discussion, rather than a request for changes in this pull request! |
I'm not aware of such a thing. It is possible to do so for plain Python code using
Sounds like a good idea.
We can additionally add tests using
I also wanted to avoid having them exported, but I also kind of need them mostly for return values. I guess the thing is people should only use them "implicitly": from jq import compile
prog = compile("...")
# prog is of type "_Program", but the user does not need to know about it.
prog.input({...}) # is of type "_ProgramWithInput, but the user also does not need to know about it. |
I think it's fine (and indeed, necessary) to expose, say, |
@mwilliamson regarding tests, do you want me to create a new tox env, or run everything in the default one? |
I think having the tests for the types run in the same envs as the existing tests is simplest, unless there's a particular downside to doing so? |
Fixes #105.
I'm not sure if the
.pyi
file needs to be explicitly included for setuptools?