How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

Cameron Simpson cs at cskk.id.au
Sun Jan 29 16:19:03 EST 2023


On 29Jan2023 07:12, 2QdxY4RzWzUUiLuE at potatochowder.com <2QdxY4RzWzUUiLuE at potatochowder.com> wrote:
>On 2023-01-29 at 16:51:20 +1100,
>Cameron Simpson <cs at cskk.id.au> wrote:
>> They're unrelated. As others have mentioned, "--" is _extremely_ 
>> common;
>> almost _all_ UNIX command like programmes which handle -* style options
>> honour the "--" convention. _argparse_ itself honours that convention, as
>> does getopt etc.
>
>And why do UNIX programs behave this way?
>
>Because POSIX says they should:
>
>    https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html

Aye, but POSIX says they should because POSIX formalises a lot of 
existing practices so that people have a reference to let them _also_ 
use that practice in a consistent way.

I used to lurk on the POSIX discussion list, and the length of the 
discussions around corner cases was quite wearing, even just to read.

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Python-list mailing list