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 telmich
Recipients bethard, r.david.murray, telmich
Date 2012-10-24.14:17:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1351088238.34.0.83176639032.issue16308@psf.upfronthosting.co.za>
In-reply-to
Content
Assuming 3.3.0 behaviour is correct (as in no subparser specified, args.func not setup), I'd expect to have setup a function on the main parser. Trying this, it prevents the subparsers function from being completly:

[16:03] brief:~% python3 subparse3.py                 
main: Namespace(func=<function main at 0x7fdf844b90e0>, x=2, y=1.0)
main: Namespace(func=<function main at 0x7fdf844b90e0>, z='XYZYX')
main: Namespace(func=<function main at 0x7fdf844b90e0>)

Added lines to the original documentation are:

def main(args):
    print('main: %s' % args)
...
parser.set_defaults(func=main)
...
args = parser.parse_args('')
args.func(args)
History
Date User Action Args
2012-10-24 14:17:18telmichsetrecipients: + telmich, bethard, r.david.murray
2012-10-24 14:17:18telmichsetmessageid: <1351088238.34.0.83176639032.issue16308@psf.upfronthosting.co.za>
2012-10-24 14:17:18telmichlinkissue16308 messages
2012-10-24 14:17:18telmichcreate