Author remram
Recipients Changaco, bethard, ezio.melotti, mikn, nailor, paul.j3, petri.lehtinen, python-dev, r.david.murray, remram, smparkes
Date 2015-06-03.18:35:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1433356556.96.0.609820978518.issue9351@psf.upfronthosting.co.za>
In-reply-to
Content
To me this is much more than a compatibility problem. The way it worked before made a lot of sense, and just felt like the "correct" solution to accept a flag in multiple places.

Having a --verbose flag is something everybody should consider (Python has a decent builtin logging module), and anybody providing it would definitely want to accept it before and after subcommands (or at least, for every subcommand).

The only way right now is to not only create different arguments with add_argument(), for each parser, but you also need to provide different destination names (and then do something shitty like verbosity = args.verb_main+args.verb_subcommand). This bug makes argparse completely unusable for any real-life application that uses subparsers (in addition to breaking existing programs). And it breaks silently too, simply amazing!

Of course there is very little point in fixing this now. Since this affects multiple released versions of Python, I have to use a work-around anyway (until I can move from argparse to something that won't decide to break someday for the hell of it).
History
Date User Action Args
2015-06-03 18:35:57remramsetrecipients: + remram, bethard, ezio.melotti, r.david.murray, nailor, python-dev, petri.lehtinen, paul.j3, mikn, Changaco, smparkes
2015-06-03 18:35:56remramsetmessageid: <1433356556.96.0.609820978518.issue9351@psf.upfronthosting.co.za>
2015-06-03 18:35:56remramlinkissue9351 messages
2015-06-03 18:35:56remramcreate