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
gh-91462: Make lltrace output human-readable. #91463
Conversation
Example output: In example.py: __ltrace__ = 1
def gen():
yield 10
yield 20
def main():
for x in gen():
x = x * x
print(x)
main() Result:
|
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.
I like this a lot. Thanks, it will be much more useful now!
class TestLLTrace(unittest.TestCase): | ||
|
||
def run_code(self, code): |
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.
(Surprised there isn't already a utility for this.)
x = 42 | ||
y = -x | ||
dont_trace_1() | ||
__ltrace__ = 1 |
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 tripped me over! :-) It almost seems like a bug that the feature is called LLTRACE but the dunder is __ltrace__
...
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.
It seems to be a decade-old typo introduced here: 3c1e481
We could maybe accept both __ltrace__
and __lltrace__
at this point?
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.
Eh, just change to __lltrace__
. This feature is too niche to require backward compatibility (nobody complained when it was broken 10 years ago :-).
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.
Don't change a thing! Land it.
I'll do the |
Thanks for the reviews! |
resume_frame:
#91462