Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
82e1c08a
Commit
82e1c08a
authored
Oct 17, 2016
by
Berker Peksag
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #28455: Clarify example of overriding the convert_arg_line_to_args method
Patch by Mariatta Wijaya.
parent
91c398fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
Doc/library/argparse.rst
Doc/library/argparse.rst
+4
-3
No files found.
Doc/library/argparse.rst
View file @
82e1c08a
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment