This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author paul.j3
Recipients matej.tyc, paul.j3
Date 2013-07-20.04:26:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1374294406.76.0.0861883216377.issue18467@psf.upfronthosting.co.za>
In-reply-to
Content
Since parse_args takes an optional Namespace argument, you can set the its initial value to almost anything.  For example, with the functions defined previously:

    parser = argparse.ArgumentParser()
    parser.add_argument('-a','--algorithm', choices=['Q','S'], action=FooAction, type=bar)
    NS = parser.parse_args(['-a','S'])
    args = parser.parse_args(None, NS)

The first parse_args uses FooAction to create a default Namespace, which is then passed to the second.
History
Date User Action Args
2013-07-20 04:26:46paul.j3setrecipients: + paul.j3, matej.tyc
2013-07-20 04:26:46paul.j3setmessageid: <1374294406.76.0.0861883216377.issue18467@psf.upfronthosting.co.za>
2013-07-20 04:26:46paul.j3linkissue18467 messages
2013-07-20 04:26:46paul.j3create