[Python-Dev] Pronouncement on PEP 389: argparse?

Steven Bethard steven.bethard at gmail.com
Sun Dec 27 19:00:23 CET 2009


On Sun, Dec 27, 2009 at 9:51 AM, anatoly techtonik <techtonik at gmail.com> wrote:
> On Tue, Dec 15, 2009 at 12:37 AM, Steven Bethard
> <steven.bethard at gmail.com> wrote:
>>
>> If you're only concerned about 2.X, then yes, optparse will *never* be
>> removed from 2.X. There will be a deprecation note in the 2.X
>> documentation but deprecation warnings will only be issued when the -3
>> flag is specified. Please see the "Deprecation of optparse" section of
>> the PEP:
>>
>> http://www.python.org/dev/peps/pep-0389/#deprecation-of-optparse
>
> I do not think that optparse should be deprecated at. It is good at
> what it does and its limitations make its starting point less
> confusing for people with different backgrounds that Python.
>
> Compare:
> http://docs.python.org/library/optparse.html
> http://argparse.googlecode.com/svn/tags/r101/doc/index.html

This sounds like a request for a documentation change. Because you can
write almost identical code with argparse to that in the optparse
intro. If you just replace "optparse" with "argparse", "OptionParser"
with "ArgumentParser", and "(options, args)" with "args", the code
will work exactly the same. (Actually, better because the usage
message will be better.)

If you have specific suggestions on how you'd like the documentation
updated, please file a feature request in the argparse bug tracker:
http://code.google.com/p/argparse/issues

Steve
-- 
Where did you get that preposterous hypothesis?
Did Steve tell you that?
        --- The Hiphopopotamus


More information about the Python-Dev mailing list