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
.pyifile needs to be explicitly included for setuptools?