paul j3 added the comment:

argparse roughly follows POSIX practice:

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html

    Guideline 10:
    The first -- argument that is not an option-argument should be 
    accepted as a delimiter indicating the end of options. Any 
    following arguments should be treated as operands, even if they 
    begin with the '-' character.

I don't think this kind of thing is fixed, but there should be good reason to 
make an enhancement.  For many users argparse is already too complicated, and 
the docs are hard to understand.  Yet another parameter can get lost.

There are some known problems with this '--', specially when there are more 
than one.  It may also have problems when used with subparers, though I forget 
the details.

It wouldn't hard to substitute a CONST variable for this '--', and wouldn't 
require changes to the API.  

Another possibility is to change this '--' to 'parser.prefix_chars[0]*2'.  
Documenting that would be more work than implementing it.  And we'd have to add 
a unittest case.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31012>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to