-
Notifications
You must be signed in to change notification settings - Fork 369
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
Make the inspect
module compatible with Hy
#1696
Labels
Comments
allison-casey
added this to Nice to have
in Hy 1.0 (The Grand Language Cleanup 2: Electric Boogaloo)
Mar 23, 2021
Closed
Looking at the source of |
You're welcome to. But I would want a test for this feature, and it's the kind of thing that could be more laborious to write a test for than to implement. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
inspect
module isn't compatible with some Hy-derived objects, and code that implicitly usesinspect
(including other standard library modules) is generally error-prone because of this.In particular, debuggers are a lot less useful due to these
inspect
incompatibilities. For example,ll
doesn't work properly even when source is correctly associated with function/code objects.For another particularly interesting example, notice how PyPy raises exceptions during calls to
inspect.getsource
:CPython raises no exception, but the result it gives is incomplete:
The debugger triggers a call to
inspect
during code listing, and a-1
start-of-line is returned by PyPy'sinspect.findsource
. This causesinspect.getsourcelines
to sendinspect.getblock
only the last line and, ultimately, the Python tokenizer to barf.We might be able to introduce some patches that fix these issues.
Originally posted by @brandonwillard in #1680 (comment)
The text was updated successfully, but these errors were encountered: