getopt with negative numbers?

Casey Caseyweb at
Thu Sep 27 19:46:37 CEST 2007

On Sep 27, 1:34 pm, Peter Otten <__pete... at> wrote:
> optparse can handle options with a negative int value; "--" can be used to
> signal that no more options will follow:

Thanks, Peter.  getopt supports the POSIX "--" end of options
indicator as well, but that seems a little less elegant than being
able to simply set a value that tells the parser "I don't use any
numeric values as options, and I want to allow negative values as
arguments".  At the parser level implemening this would be trivial and
I frankly was hoping it had been implemented and it just wasn't
mentioned in the spares Python getopt library reference.

More information about the Python-list mailing list