4 ms·
Why shouldn't they be relevant? Getopt is still very useful for short scripts and optparse does everything it was meant to do, even if it's not as full of featu
by gvalkov 14y ago
Why shouldn't they be relevant? Getopt is still very useful for short scripts and optparse does everything it was meant to do, even if it's not as full of features as argparse. Maybe argparse really should be the canonical choice, but I certainly wouldn't want to see the others gone.
As for a minor complaint about argparse - setting up a custom help formatter [1] is not straightforward, not in the slightest in comparison to optparse [2] (which is much simpler, implementation wise).
[1] http://hg.python.org/cpython/file/default/Lib/argparse.py#l144 http://hg.python.org/cpython/file/default/Lib/argparse.py#l1...
[2] http://hg.python.org/cpython/file/2.7/Lib/optparse.py#l155 http://hg.python.org/cpython/file/2.7/Lib/optparse.py#l155