• Re: A new feature request - parser add_mutually_exclusive_group - add a

    From Paul Rubin@3:633/280.2 to All on Tue Jul 9 16:04:14 2024
    Subject: Re: A new feature request - parser add_mutually_exclusive_group - add a default value

    I looked at the linked SO post and it seems to be a feature suggestion
    for the argparse library. Python's bug tracker is currently at:

    https://github.com/python/cpython/issues

    You might want to open an issue there with a concrete proposal.

    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Stefan Ram@3:633/280.2 to All on Tue Jul 9 16:12:53 2024
    Subject: Re: A new feature request - parser add_mutually_exclusive_group - add a default value

    =?UTF-8?B?15DXldeo15k=?= <uri@speedy.net> wrote or quoted:
    1. Is there a way to add a default to parser add_mutually_exclusive_group >groups - a value that will be set by default? In this case I
    want test-default-languages=True to be set as a default.

    I am not aware of such a possibility. But you could write a function
    to parse the arguments using argparse, then inspect the parsed_args,
    and modify them to reflect your default if no other argument was
    detected. However, I have no experience with using argparse at all,
    so it is well possible that someone who is proficient in argparse
    might actually know how to set a default value there!

    2. I tried to subscribe to Python-ideas python-ideas@python.org, but I
    can't login to

    It might be necessary to once create an account for the new
    Mailman3 system. As I have no experience with mailing lists
    whatsoever, this is just a wild guess!

    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: Stefan Ram (3:633/280.2@fidonet)