Skip to content
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 a built-in stringifier to display the object's id() #429

Merged
merged 3 commits into from
Feb 2, 2021

Conversation

mvanderkamp
Copy link
Contributor

I've been using this as a custom stringifier for a while, but I think it is useful and generic enough to warrant inclusion as a built-in.

Use cases typically involve quickly checking whether or not two "equal" variables point to the same object.

Thoughts? I think I hooked this up in all the right places. I've also thrown in a change to use the new ui_log to print errors when trying to run the custom stringifier, since currently the message mucks with the rendering of the debugger.

Currently it was interfering with the code window (printed in the
background). This can be easily triggered by pressing 'c' on a variable
when you haven't set up a custom stringifier
@inducer
Copy link
Owner

inducer commented Feb 2, 2021

Thanks! When I played around with it, I was a bit surprised that it didn't work on int and str (among a few other types), but that's not the fault of this PR. (Do you think that's worth addressing?)

At any rate, LGTM! Thanks for your contribution.

@inducer inducer merged commit da44ac3 into inducer:master Feb 2, 2021
@mvanderkamp
Copy link
Contributor Author

Yeah I do think that's worth addressing. I'm just looking through the issues list...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants