Message193112
| Author |
vajrasky |
| Recipients |
bethard, eric.araujo, htnieman, manveru, paul.j3, tshepang, vajrasky, xuanji, ysj.ray |
| Date |
2013年07月15日.15:45:26 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1373903127.08.0.863390237164.issue11874@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
paul j3, thanks for reviewing my patch and giving me credit in your patch for another ticket.
Yeah, as you could see, the reason I return arg_parts and text is because the text still needs to undergo the cleanup process. You solved it by putting cleaning up in inner function.
I am thinking whether it is best to do "assert ' '.join(opt_parts) == opt_usage" inside _format_actions_usage helper function.
In that way, we can avoid returning the text. We can return only the arg_parts.
Anyway, my patch still got some unused variables, notably part_regexp and inner. My bad.
Let me check the code more deeply. See whether I can architect my patch in a better way. Maybe we can avoid building separate list inside _format_actions_usage.
Beside of that, this bug is not introduced solely by bracket character. It needs another non-space character on the right side of it.
This line is fine:
parser.add_argument ('--b', metavar="[innerpart] outerpart")
This line will fail the assertion:
parser.add_argument ('--b', metavar="[innerpart]outerpart") |
|