[issue25475] use argparse instead of getopt

R. David Murray report at bugs.python.org
Sun Oct 25 15:10:56 EDT 2015


R. David Murray added the comment:

This was discussed when argparse was included in the standard library, and the conclusion was that getopt serves a different purpose than argparse and should not be deprecated.  argparse is mentioned as an alternative since in many cases it is to be preferred, but there are cases where getopt is the better choice.  (I myself have a command line parsing library (not yet published) that uses getopt as its base.)

As far as using argparse in the standard library, yes, we convert modules on a case by case basis when someone has the interest and the time to write tests for the existing command line behavior before doing the conversion.  And in every case we have still introduced bugs when the conversion was released, so this should not be done lightly (ie: we usually only do it when introducing new functionality or fixing a bug).

----------
nosy: +r.david.murray
stage:  -> resolved

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25475>
_______________________________________


More information about the Python-bugs-list mailing list