Skip to content

Conversation

@bluetech
Copy link
Member

@bluetech bluetech commented Nov 5, 2025

More small internal cleanups, please see the commits. With this, I think argparsing.py is decently clean code.

Already imported from a bunch of places.
The `processopt` callback currently doesn't update any fields, so this
code is not needed. And since we definitely do not want to extend the
use of `processopt`, it's fine to remove.
Same as in `OptionGroup`, this continues making our Parser code just a
simple wrapper around argparse.
It's a low-level concern so low level should handle it. And one less
thing in the `_processopt` callback which hopefully we can eventually
remove.
As recommended by Python's documentation for `__import__`.
No longer needed, forgot to remove it.
@bluetech bluetech added the skip news used on prs to opt out of the changelog requirement label Nov 5, 2025
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Unlike what the comment says, it is not called multiple times when
`--help` is used (it is not used at all when not).
No apparent need for it.
@bluetech
Copy link
Member Author

bluetech commented Nov 5, 2025

Seems like exit_on_error is broken on older Pythons: python/cpython#121018. I undid that part.

@bluetech
Copy link
Member Author

bluetech commented Nov 5, 2025

Now there is some other error on py310. I will check it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news used on prs to opt out of the changelog requirement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants