[issue9399] Provide a 'print' action for argparse

Steven Bethard report at bugs.python.org
Sun Aug 1 12:50:24 CEST 2010


Steven Bethard <steven.bethard at gmail.com> added the comment:

The patch looks basically right. A few minor issues:

* "message=None," should probably be "message,", that is, message should not be allowed to default to None - I can't see any use case for this action without a message. I believe this means the body of __call__ can be simplified to::

  self.file.write(self.message)
  self.file.write("\n")
  parser.exit()

* The other thing the patch needs is to update the test suite to add tests to make sure this behavior works. Take a look at test_argparse.py for how to do that.

* The last thing is that to have the greatest chance of having someone check this in, you'll want to make your patch against Python trunk as explained here:

http://www.python.org/dev/faq/#how-do-i-get-a-checkout-of-the-repository-read-only-or-read-write
http://www.python.org/dev/faq/#how-to-make-a-patch

Thanks!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9399>
_______________________________________


More information about the Python-bugs-list mailing list