Message173686
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) |
|
Date |
User |
Action |
Args |
2012-10-24 14:17:18 | telmich | set | recipients:
+ telmich, bethard, r.david.murray |
2012-10-24 14:17:18 | telmich | set | messageid: <1351088238.34.0.83176639032.issue16308@psf.upfronthosting.co.za> |
2012-10-24 14:17:18 | telmich | link | issue16308 messages |
2012-10-24 14:17:18 | telmich | create | |
|