classification
Title: Add an example of ArgumentParser.exit()
Type: resource usage Stage: resolved
Components: Documentation Versions: Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: bethard, docs@python, matrixise, miss-islington, paul.j3, shihai1991
Priority: normal Keywords: patch

Created on 2019-08-21 17:11 by shihai1991, last changed 2019-09-12 15:56 by matrixise. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 15455 merged shihai1991, 2019-08-24 10:11
PR 16065 merged miss-islington, 2019-09-12 15:34
Messages (6)
msg350097 - (view) Author: hai shi (shihai1991) * Date: 2019-08-21 17:11
As paul said in bpo 9938:
The exit and error methods are mentioned in the 3.4 documentation, but there are no examples of modifying them.

    16.4.5.9. Exiting methods
    ArgumentParser.exit(status=0, message=None)
    ArgumentParser.error(message)

I will update the examples in this weekend.
msg350098 - (view) Author: hai shi (shihai1991) * Date: 2019-08-21 17:12
issue 9938
msg350360 - (view) Author: hai shi (shihai1991) * Date: 2019-08-24 10:17
Adding an example of ArgumentParser.exit(), because some user would like cathing errors manually or consider exit progress or not when an error occurs.

I have not add example of ArgumentParser.error(), because i can not think some user scenarios:(
msg352202 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2019-09-12 15:34
New changeset b1a2abdb06408ffc4f13d6ff50351ad49c99afc0 by Stéphane Wirtel (Hai Shi) in branch 'master':
bpo-37908: Add an example of ArgumentParser.exit() (GH-15455)
https://github.com/python/cpython/commit/b1a2abdb06408ffc4f13d6ff50351ad49c99afc0
msg352204 - (view) Author: miss-islington (miss-islington) Date: 2019-09-12 15:43
New changeset 6dc3e61c511d3e13ce4eac86c8b6abdff58e3617 by Miss Islington (bot) in branch '3.8':
bpo-37908: Add an example of ArgumentParser.exit() (GH-15455)
https://github.com/python/cpython/commit/6dc3e61c511d3e13ce4eac86c8b6abdff58e3617
msg352207 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2019-09-12 15:56
Thank you
History
Date User Action Args
2019-09-12 15:56:25matrixisesetstatus: open -> closed
versions: + Python 3.8, Python 3.9
messages: + msg352207

resolution: fixed
stage: patch review -> resolved
2019-09-12 15:43:17miss-islingtonsetnosy: + miss-islington
messages: + msg352204
2019-09-12 15:34:36miss-islingtonsetpull_requests: + pull_request15688
2019-09-12 15:34:27matrixisesetnosy: + matrixise
messages: + msg352202
2019-08-24 10:22:52shihai1991setnosy: + bethard
2019-08-24 10:17:37shihai1991settype: resource usage
title: Add some examples of ArgumentParser.exit() -> Add an example of ArgumentParser.exit()
2019-08-24 10:17:17shihai1991setmessages: + msg350360
2019-08-24 10:11:29shihai1991setkeywords: + patch
stage: patch review
pull_requests: + pull_request15150
2019-08-21 17:12:48shihai1991setnosy: + paul.j3
2019-08-21 17:12:09shihai1991setmessages: + msg350098
2019-08-21 17:11:33shihai1991create