[issue13540] Document the Action API in argparse

2014-08-23 Thread paul j3
paul j3 added the comment: While we are talking the Action class, the documentation isn't clear that the 'add_argument' method returns an Action object, specifically one the subclasses. More than once, when answering Stackoverflow questions I've recommended assigning this object to a variable

[issue13540] Document the Action API in argparse

2014-08-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: I don't understand why, but the change worked, and is consistent with similar constructs in the same file. Pushed. Jason -- security-fix-only versions do not get doc patches. They are released as source only. -- __

[issue13540] Document the Action API in argparse

2014-08-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4a6b71d8575e by Terry Jan Reedy in branch '3.4': Issue #13540: add missing markup. http://hg.python.org/cpython/rev/4a6b71d8575e -- ___ Python tracker

[issue13540] Document the Action API in argparse

2014-08-23 Thread paul j3
paul j3 added the comment: You need line continuation characters '\' .. class:: Action(option_strings, dest, nargs=None, const=None, default=None, \ type=None, choices=None, required=False, help=None, \ metavar=None) -- _

[issue13540] Document the Action API in argparse

2014-08-23 Thread paul j3
paul j3 added the comment: Maybe the problem is with the latest documentation build, not your patch. -- ___ Python tracker ___ ___ Pyt

[issue13540] Document the Action API in argparse

2014-08-23 Thread Jason R. Coombs
Jason R. Coombs added the comment: I have no idea why that would be. I used the same syntax for the Action class as ArgumentParser. From the latest tip: .. class:: ArgumentParser(prog=None, usage=None, description=None, \ epilog=None, parents=[], \

[issue13540] Document the Action API in argparse

2014-08-21 Thread paul j3
paul j3 added the comment: The formatting of the descriptor line for this class is not consistent with the classes for this module. It lacks 'class'. It is all bold In contrast class argparse.ArgumentParser(prog=None, ... uses bold for only the name. -- __

[issue13540] Document the Action API in argparse

2014-08-03 Thread Jason R. Coombs
Jason R. Coombs added the comment: Commits applied to Python 2.7 and 3.2-3.5. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ _

[issue13540] Document the Action API in argparse

2014-08-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset e2c9e0a3ef02 by Jason R. Coombs in branch '3.2': Issue #13540: Expanded argparse documents to clarify the action API http://hg.python.org/cpython/rev/e2c9e0a3ef02 New changeset c10a6ca9cb32 by Jason R. Coombs in branch '3.2': Issue #13540: Removed r

[issue13540] Document the Action API in argparse

2014-08-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset 956c6d33a57d by Jason R. Coombs in branch '2.7': Issue #13540: Expanded argparse documents to clarify the action API http://hg.python.org/cpython/rev/956c6d33a57d New changeset 008a5473f300 by Jason R. Coombs in branch '2.7': Issue #13540: Removed r

[issue13540] Document the Action API in argparse

2014-08-03 Thread Jason R. Coombs
Changes by Jason R. Coombs : Removed file: http://bugs.python.org/file36001/9ac347a7f375.diff ___ Python tracker ___ ___ Python-bugs-list mail

[issue13540] Document the Action API in argparse

2014-08-03 Thread Jason R. Coombs
Jason R. Coombs added the comment: @paul.j3, It wasn't from a different project, it's just that the bug tracker when it does a diff always uses the tip of each branch instead of the most recent common ancestor, so it effectively calculated the the diff of the changes plus the inverse of every

[issue13540] Document the Action API in argparse

2014-07-20 Thread paul j3
paul j3 added the comment: I think you want to unlink 9ac347a7f375.diff It's from a different project -- ___ Python tracker ___ ___

[issue13540] Document the Action API in argparse

2014-07-20 Thread Jason R. Coombs
Jason R. Coombs added the comment: I've tried building the docs, but it appears to rely on a local build of Python as well as subversion, neither of which my system can do currently, so I'm hoping someone has a suitable environment to help test the building of the docs. -- ___

[issue13540] Document the Action API in argparse

2014-07-20 Thread Jason R. Coombs
Jason R. Coombs added the comment: I've made another commit to capture Steven's recommendations. I've also merged the work with the latest 2.7 tip, the result of which is the latest diff. I'll commit this in a week or two if there aren't any objections, though I would appreciate a review and e

[issue13540] Document the Action API in argparse

2014-07-20 Thread Jason R. Coombs
Changes by Jason R. Coombs : Added file: http://bugs.python.org/file36003/b8c09b766e20.diff ___ Python tracker ___ ___ Python-bugs-list mailin

[issue13540] Document the Action API in argparse

2014-07-20 Thread Jason R. Coombs
Changes by Jason R. Coombs : Added file: http://bugs.python.org/file36001/9ac347a7f375.diff ___ Python tracker ___ ___ Python-bugs-list mailin

[issue13540] Document the Action API in argparse

2014-07-16 Thread Jason R. Coombs
Jason R. Coombs added the comment: That's interesting that there's activity on this again. I had forgotten I'd filed it. It's particularly timely, as I just yesterday had this experience again. I looked at the documentation and found it inadequate for me to understand how to implement a custom

[issue13540] Document the Action API in argparse

2014-07-16 Thread Mark Lawrence
Mark Lawrence added the comment: @Paul what is your opinion of this documentation patch? -- nosy: +BreamoreBoy, paul.j3 versions: +Python 3.4, Python 3.5 -Python 3.2, Python 3.3 ___ Python tracker _

[issue13540] Document the Action API in argparse

2012-03-18 Thread Tshepang Lekhonkhobe
Changes by Tshepang Lekhonkhobe : -- nosy: +tshepang ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue13540] Document the Action API in argparse

2011-12-15 Thread Steven Bethard
Steven Bethard added the comment: Sorry about being out of contact (I'm flying back and forth between the US and the EU every 4-5 weeks right now), and thanks Terry for bringing this to my attention. Essentially, the API is: * The argument to action= must be a callable that accepts at least

[issue13540] Document the Action API in argparse

2011-12-14 Thread Jason R. Coombs
Jason R. Coombs added the comment: Most of the Action subclasses in argparse override __init__ and they raise ValueErrors when the parameters aren't as expected for that argument. This was my reason for adding that comment. If the basic Actions require this level of validation, wouldn't a cus

[issue13540] Document the Action API in argparse

2011-12-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: My guess from the way the docs are written now is that subclassing from Action and over-riding just the __call__ method is the intended way, not just the recommended. If so, Action is a quasi-private class, only exposed so it could be subclassed with one meth

[issue13540] Document the Action API in argparse

2011-12-13 Thread Jason R. Coombs
Changes by Jason R. Coombs : -- keywords: +patch Added file: http://bugs.python.org/file23949/956c6d33a57d.diff ___ Python tracker ___ ___

[issue13540] Document the Action API in argparse

2011-12-13 Thread Jason R. Coombs
Jason R. Coombs added the comment: I've attached a repository and patch with the recommended changes. I created an additional section that includes the documentation for the Action class (specifically the __init__ and __call__ signatures). I believe this addresses the issues I raised. Any obj

[issue13540] Document the Action API in argparse

2011-12-13 Thread Jason R. Coombs
Changes by Jason R. Coombs : -- hgrepos: +95 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue13540] Document the Action API in argparse

2011-12-13 Thread Jason R. Coombs
Jason R. Coombs added the comment: You're right. The documentation isn't incorrect, if you're splitting hairs. But it's not super friendly either. Questions that the documentation should answer: 1) Does the action always need to be a subclass of an Action, or is that recommended? If it's rec

[issue13540] Document the Action API in argparse

2011-12-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: The doc specified the Action API as the interface inherited from argparse.Action plus the addition of a custom __call__ method with 4 params (5 with self) as described. That seems mostly adequate to me, unless there is something missing in the parameter descr

[issue13540] Document the Action API in argparse

2011-12-10 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +bethard, eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://

[issue13540] Document the Action API in argparse

2011-12-06 Thread Jason R. Coombs
Changes by Jason R. Coombs : -- title: Document the Action API -> Document the Action API in argparse ___ Python tracker ___ ___ Pytho

[issue13540] Document the Action API

2011-12-06 Thread Jason R. Coombs
New submission from Jason R. Coombs : In http://docs.python.org/dev/library/argparse.html#action, when describing an arbitrary action, the documentation states, "You can also specify an arbitrary action by passing an object that implements the Action API." This statement does not link to any d