[issue17050] argparse.REMAINDER doesn't work as first argument

Alden report at bugs.python.org
Tue Apr 24 14:13:31 EDT 2018


Alden <aldencolerain at gmail.com> added the comment:

Paul.  This is a bug, not a feature in argparse.  Devin is 100% correct.  According to the docs REMAINDER should be greedy and is used for passing arguments to sub commands.  In your example the expected behavior is that if you do put "d --foo x a b c" that --foo is none and args gets everything.  We shouldn't need to use a gatekeeper or resort to manually parsing the remainder arguments.  It also shouldn't take 5 years to acknowledged that it needs to be fixed.  I'm happy to make a patch if its a bandwidth issue.  Am I misunderstanding and you feel like its not possible to fix?  I guess if there is a backward compatibility issue then we need to write a new option that does literally return the remainder arguments as documented.

----------
nosy: +aldencolerain

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17050>
_______________________________________


More information about the Python-bugs-list mailing list