[stdlib-sig] should we try to add argparse?

Brett Cannon brett at python.org
Thu Sep 10 23:35:17 CEST 2009


On Thu, Sep 10, 2009 at 14:31, Collin Winter <collinw at gmail.com> wrote:
> On Thu, Sep 10, 2009 at 6:14 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:
>>
>>> Upfront people need to realize that we might have three argument
>>> parsing libraries for a while, but it won't be forever. If we get
>>> argparse accepted we would slowly deprecate at least optparse, if not
>>> getopt (lat time I tried to ditch getopt for Python 3 some argued that
>>> getopt supported stuff optparse didn't),
>>
>> +0 on deprecating getopt, -1 on deprecating optparse. Breaking a
>> perfectly functional and useful module is stupid.
>
> Do remember that if optparse is deprecated, it will still be available
> for *years*. Code isn't going to suddenly break overnight. Users will
> see this coming far, far ahead of time.
>

I suspect we would do at least one release as
PendingDeprecationWarning, and one with DeprecationWarning. But there
is a much bigger chance they will stay w/ DeprecationWarning for a
couple of releases. Plus the code will be made available on PyPI for
people to download and use on their own w/ no deprecation warning.

> How many more ways do we need to do argument parsing? If argparse is
> added, I'd like to see both getopt and optparse begin their
> deprecation cycles in the same release. Three separate ways of doing
> argument parsing in the stdlib is madness.

So would I. I looked up the original arguments against removing getopt
for Python 3 so we can make sure everyone is happy w/ ditching both
modules.

-Brett


More information about the stdlib-sig mailing list