gh-116023: Add show_empty=False to ast.dump#116037
Conversation
JelleZijlstra
left a comment
There was a problem hiding this comment.
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.
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.dumpshow_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 :) |
carljm
left a comment
There was a problem hiding this comment.
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
carljm
left a comment
There was a problem hiding this comment.
LGTM, one minor nit on the docs.
Co-authored-by: Carl Meyer <carl@oddbird.net>
|
(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/