From: Berker Peksag Date: Mon, 17 Oct 2016 03:14:17 +0000 (+0300) Subject: Issue #28455: Clarify example of overriding the convert_arg_line_to_args method X-Git-Tag: v3.6.0b3~114^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5493e4723a922b9905cf6916363e72109a531cfd;p=thirdparty%2FPython%2Fcpython.git Issue #28455: Clarify example of overriding the convert_arg_line_to_args method Patch by Mariatta Wijaya. --- diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index fab072788f50..879bfed7e37f 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -1958,10 +1958,11 @@ Customizing file parsing The method is called once per line read from the argument file, in order. A useful override of this method is one that treats each space-separated word - as an argument:: + as an argument. The following example demonstrates how to do this:: - def convert_arg_line_to_args(self, arg_line): - return arg_line.split() + class MyArgumentParser(argparse.ArgumentParser): + def convert_arg_line_to_args(self, arg_line): + return arg_line.split() Exiting methods