-
Notifications
You must be signed in to change notification settings - Fork 283
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
Question: Extracting Type information from pytype #1678
Comments
Perhaps this will help? https://google.github.io/pytype/developers/tools.html#merge_pyi As for your example of For this particular situation, as long as you have a call to |
Thanks for the response! Oh, I thought the .pyi files would not contain the information about the types if they are already annotated or would it always contain the type hints no matter whether it's already annotated or not? I can't seem to find the tool pytd-tool (mentioned to be a parser for .pyi files, in the main readme) is it removed. I see, I am not really worried about false positive type errors, because I basically want to use pytype as a part of a pipeline for a tool I am trying to build, to extract type information for specific types. Basically, I want to take advantage of the static type propagation to output as many types as possible for specific functions. |
poke around the xref code and see if anything in there helps you. at this point the indexer should contain type information for various symbols. also merge-pyi might be helpful - in general the tools/ directory contains several examples of using pytype as a library. |
Hello, I actually want to know if there's a possibility of extracting type information about an application from pytype. I want to analyze an application (along with its tests etc) and see if I can extract the type information for every parameter, return value and attribute.
When I try to run the tool, it tries to every generalize stuff to
Any
, I would rather have with a list of (incomplete) possible types that can be passed to this function parameter.PS : also is there any configuration options to make the tool identify cases such as :
The text was updated successfully, but these errors were encountered: