This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author paul.j3
Recipients Leon Avery, paul.j3, steven.daprano
Date 2017-08-01.07:13:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1501571590.3.0.367837354312.issue31012@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-08-01 07:13:10paul.j3setrecipients: + paul.j3, steven.daprano, Leon Avery
2017-08-01 07:13:10paul.j3setmessageid: <1501571590.3.0.367837354312.issue31012@psf.upfronthosting.co.za>
2017-08-01 07:13:10paul.j3linkissue31012 messages
2017-08-01 07:13:09paul.j3create