-
Notifications
You must be signed in to change notification settings - Fork 123
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 more info to names()
in Python API
#1512
Conversation
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.
This looks reasonable to me, aside from one design question.
This PR should be ready now. This last commit gives types to the output of Note that in making that change, I converted the |
I realize I'm months late, but would it be easy to add the line number where the definition of the name appears to the info that's returned? |
As touched upon in #1492, currently the remote API does not provide as much information about names as the
browse
command does in the REPL. This PR expands the result of thevisible names
method (i.e.names()
in the Python API) to include:browse
command (i.e. what module the name is from, whether or not it is a parameter, and whether or it not it is a property), as well asThis PR also adds the
property_names
andparameter_names
functions to the Python API, which return only those names which are properties or parameters, respectively.Finally, this PR also fixes a bug where
names()
would sometimes hang when a parameterized module is loaded.See
test_names.py
for an example of this new output ofnames
as well as the new theproperty_names
andparameter_names
functions.Looking ahead: At some point it might also be nice to have
type_names
andmodule_names
commands which return similar results tonames
, just for these other two distinct namespaces in Cryptol. It might also be nice to have an easy way to prove a property retrieved fromproperty_names
.