Getopt and optparse vs argparse

My stance is that it was a mistake to recomend the argparse module as the only true CLI parsing module and drop-in replacement of the optparse module, while it was not. It’s not only a different API, but different behavior. We cannot undo this. But we can stop doing more harm, stop misleading users. Most of current argparse users are victims of our advertising. Users should be able to make informed choices between simpler API that implements traditional CLI and more feature-rich experimental API that implements non-orthodox CLI.

Ideally, we should have a feature-rich API with configurable behavior, which provides user-friendly but non-ambiguous CLI. But argparse is still in experimental stage, after 15 years.

8 Likes