-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-116023: Add show_empty=False
to ast.dump
#116037
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
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.
Thank you for picking this up!
Updated! Thank you! |
I will wait for some third opinion, maybe someone else has input: whether this should be a default or not. Thanks for the review! |
Maybe @carljm or @hauntsaninja ? :) |
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 think if we have the feature it should be on by default. Since it's sort of a convenience / conciseness feature, it's not as useful if it's off by default. Also seems fairly safe to keep on by default, since that's basically what 3.12's ast.dump will give you.
FWIW, I agree with @hauntsaninja and @JelleZijlstra. I think in the more common use cases, seeing empty values is noisy and not useful, and
That depends on whether you are talking about I still think it's the better behavior, though. I would rather see
by default, instead of
|
show_empty=True
to ast.dump
show_empty=False
to ast.dump
Ok, fair enough! I've changed the default from |
Waiting for some time for @hauntsaninja and @carljm to provide feedback :) |
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.
LGTM, modulo comments. Thanks!
Misc/NEWS.d/next/Library/2024-02-28-11-51-51.gh-issue-116023.CGYhFh.rst
Outdated
Show resolved
Hide resolved
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.
LGTM, one minor nit on the docs.
Co-authored-by: Carl Meyer <[email protected]>
(Waiting for one more day) |
Thanks everyone! 🎉 |
Maybe we should also mention this in |
My thoughts:
ast.dump()
#116023📚 Documentation preview 📚: https://cpython-previews--116037.org.readthedocs.build/