bpo-37908: Add an example of ArgumentParser.exit()#15455
bpo-37908: Add an example of ArgumentParser.exit()#15455matrixise merged 11 commits intopython:masterfrom
Conversation
Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
|
cc @rhettinger |
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Doc/library/argparse.rst
Outdated
| this method to handle these steps differently:: | ||
|
|
||
| import sys | ||
|
|
There was a problem hiding this comment.
just one line,
import sys
class ErrorCatchingArgumentParser(argparse.ArgumentParser):
passThere was a problem hiding this comment.
I check some other examples in rst, single line is fine.
There was a problem hiding this comment.
Yet the rst indentation is wrong (single space)
There was a problem hiding this comment.
@JulienPalard And i think it is confusing some users too :(.
I found some code examples in rst using >>> and the others don't using >>> like this example. it is confusing too(i don't have time to look the details.)
There was a problem hiding this comment.
Blocks with '>>>' are here to demostrate an interactive session (when the responses are important), like:
>>> 1.2 - 1.0
0.19999999999999996The ones with no '>>>' are to demonstrate code (implementation of classes, functions, ...) when there is typically no result, like:
def foo(x, y):
return 5 * x - 3 * y
There was a problem hiding this comment.
Oh, thanks, Julien Palard. First time to know the difference.
|
@matrixise oh, forgive me to cover your patch, i reverse to your patch. |
|
Please, stop to change the code, because your PR was ok, and Travis restart a new job at each push. and Travis is not quick ;-) |
Forgive me. I stop changing the code now.
|
|
Nice, thank you |
|
Thanks @shihai1991 for the PR, and @matrixise for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8. |
|
GH-16065 is a backport of this pull request to the 3.8 branch. |
|
Thanks a million, guys. Looks all my PR which waiting core developer review have been merged. |
https://bugs.python.org/issue37908