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
argparse with subcommands difference in python 2.7 / 3.5 #72397
Comments
In python 2.7.12 I get an error if I do not pass Here is the console output: D:\util\python\test>py -3 test_argparse.py D:\util\python\test>py -2 test_argparse.py D:\util\python\test> |
The behavior change is from bpo-10424. Do you believe the new behavior is incorrect? |
I am not an expert with argparse since I just started using it But if I didn't misunderstand something it should behave like the python 2.7 version: Or:
|
Based on the usage output, it looks like the subcommand is required, but I'm not sure if there are cases where a subcommand could be optional. David, can you advise? usage: test_argparse.py [-h] command ... |
Yes there was/is a bug that made subparsers optional. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: