Carl Banks wrote:
> On Sep 28, 9:51 am, Steven Bethard <[EMAIL PROTECTED]> wrote:
>> It was decided that practicality beats purity here. Arguments with
>> leading hyphens which look numeric but aren't in the parser are
>> interpreted as negative numbers. Arguments with leading hyphens which
>> don'
On Sep 28, 9:51 am, Steven Bethard <[EMAIL PROTECTED]> wrote:
> Ben Finney wrote:
> > Steven Bethard <[EMAIL PROTECTED]> writes:
> >> Argparse knows what your option flags look like, so if you specify
> >> one, it knows it's an option. Argparse will only interpret it as a
> >> negative number if y
Ben Finney wrote:
> Steven Bethard <[EMAIL PROTECTED]> writes:
>> Argparse knows what your option flags look like, so if you specify
>> one, it knows it's an option. Argparse will only interpret it as a
>> negative number if you specify a negative number that doesn't match
>> a known option.
>
>
Steven Bethard <[EMAIL PROTECTED]> writes:
> Did you try it and find it didn't work as you expected?
No, I was commenting on the behaviour you described (hence why I said
"That would be irritating").
> Argparse knows what your option flags look like, so if you specify
> one, it knows it's an opt
Ben Finney wrote:
> Steven Bethard <[EMAIL PROTECTED]> writes:
>
>> In most cases, argparse (http://argparse.python-hosting.com/)
>> supports negative numbers right out of the box, with no need to use
>> '--':
>>
>> >>> import argparse
>> >>> parser = argparse.ArgumentParser()
>> >>> p
Steven Bethard <[EMAIL PROTECTED]> writes:
> In most cases, argparse (http://argparse.python-hosting.com/)
> supports negative numbers right out of the box, with no need to use
> '--':
>
> >>> import argparse
> >>> parser = argparse.ArgumentParser()
> >>> parser.add_argument('-a', typ