Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

You will be singled out for promotion in your work.


comp / comp.lang.python / Re: A new feature request - parser add_mutually_exclusive_group - add a default value

SubjectAuthor
* A new feature request - parser add_mutually_exclusive_group - add a default valuאורי
+- Re: A new feature request - parser add_mutually_exclusive_group - add a default Paul Rubin
`- Re: A new feature request - parser add_mutually_exclusive_group - add a default Stefan Ram

1
Subject: A new feature request - parser add_mutually_exclusive_group - add a default value
From: אורי
Newsgroups: comp.lang.python
Date: Tue, 9 Jul 2024 05:13 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: uri@speedy.net (אורי)
Newsgroups: comp.lang.python
Subject: A new feature request - parser add_mutually_exclusive_group - add a
default value
Date: Tue, 9 Jul 2024 08:13:57 +0300
Lines: 20
Message-ID: <mailman.25.1720502024.2981.python-list@python.org>
References: <CABD5YeHvY8GkzDcKkc1cEzHKkAEcHcLYpQ_-WLpuCC-Df4WFZw@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de Pc9wiOT+ruCnwgpLmN+KEA7cGgQtBiPuWOd12RZAPFmw==
Cancel-Lock: sha1:oysoelpWlB7+SkTfULsF+6PAPeA= sha256:GPurW2sLP77BJ4ihq2naKybJdFf0GUwk7xpi6qgOjhM=
Return-Path: <uri@speedy.net>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="1024-bit key; unprotected key"
header.d=speedy.net header.i=@speedy.net header.b=XmfGeT+r;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.033
X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'subject:add': 0.07;
'subject:value': 0.07; 'python-ideas': 0.09; 'url:mailman': 0.15;
'default.': 0.16; 'post:': 0.16; 'subject:default': 0.16;
'to\xc2\xa0': 0.16; 'url:options': 0.16; "can't": 0.17; 'to:addr
:python-list': 0.20; 'url-ip:188.166.95.178/32': 0.25; 'url-
ip:188.166.95/24': 0.25; 'url-ip:188.166/16': 0.25; 'tried': 0.26;
'url:lists': 0.26; 'subscribe': 0.28; 'subject:request': 0.28;
'default': 0.31; 'url-ip:188/8': 0.31; 'to:name:python': 0.32;
'url:mailman3': 0.32; 'message-id:@mail.gmail.com': 0.32; 'but':
0.32; 'there': 0.33; 'received:google.com': 0.34; 'thanks,': 0.36;
'way': 0.38; 'want': 0.40; 'from:charset:utf-8': 0.64; 'look':
0.65; 'skip:t 20': 0.66; 'url-ip:104.18/16': 0.67; 'url-ip:lookup
error': 0.70; '8bit%:6': 0.71; 'email addr:python.org,': 0.81;
'subject: \n ': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=speedy.net; s=google; t=1720502022; x=1721106822; darn=python.org;
h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
:date:message-id:reply-to;
bh=D4UcLk4sJu8FqMnm8IIPuYtqgzKaWDVpXAoQfpYhw2U=;
b=XmfGeT+rpvjYh7SOEFKZj0MQv828XElr2DZjK4D93QFv9J9NeSs50Jjdu3O1PKgk2e
VJjXUMsgqLM4VPtvGtt++ouVP2F9Vp/odTIZ4SvE0gDOC9g9PBHTB/lh4V66vR0iAxXa
aImsii70QOGm5rfBIf4/KyoWKZ1CzAE3IWjqs=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1720502022; x=1721106822;
h=to:subject:message-id:date:from:mime-version:x-gm-message-state
:from:to:cc:subject:date:message-id:reply-to;
bh=D4UcLk4sJu8FqMnm8IIPuYtqgzKaWDVpXAoQfpYhw2U=;
b=CT7kXncjGcdikvoZ6UjHw2iAQPbyxhcsDI0Jro8DSweZHNiB+fYnXTdhRzA7ESy1W9
lAw3MN+b4jajWluRkMlpVLRzw0t38nWXgps60eYnc/dzXc4J5cVEN2nz8Lljw6EHo3vc
FT5aCRMReZfLaTZXEtlNBgQOvWXHy8Z7vcavyA6A0UY3k0F8HXQ1UJTUR0ezRbl2KBqx
+poHSi6JdzFqGjpsH+JVDqYOgpf7HkkmbTP+yU5+32wFidaU1lfPSdkaRQa3JN6bwium
A4sJLXSOSH0Bm3gIQtzqsstBVhGXaSaS3cxHlIUOlh/dO3cZavA/8j2+Eyj0dz19ORL7
dEWQ==
X-Gm-Message-State: AOJu0YzeiBApnozCDwlD3SC7+8fE2wMbejS5KtKmdSSN0pqOJn3Xyr8q
LHKYMmuN51az7/rSmac1SHd3HhqBp4yQDmSfVOunznYJN7b242AJGprEPdjATuwO2RheM6yset5
W/3hgetFb3sITRQvkQvAFD1jEjYE/IpKaOdJBR+EH4fZtCjlP1L8=
X-Google-Smtp-Source: AGHT+IH04aCpecWljW0Qq8VAbnXJtitK3OO39b5DFMlYsIPqzHR28OEF5s7oy0/ASFPb2xHf/ngr7JR5YPN2ChuWoVE=
X-Received: by 2002:a05:6870:a2c8:b0:254:f00e:56a2 with SMTP id
586e51a60fabf-25eae76459emr1165077fac.9.1720502021677; Mon, 08 Jul 2024
22:13:41 -0700 (PDT)
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CABD5YeHvY8GkzDcKkc1cEzHKkAEcHcLYpQ_-WLpuCC-Df4WFZw@mail.gmail.com>
View all headers

Hi,

Please look at this Stack Overflow post:
https://stackoverflow.com/questions/78722378/parser-add-mutually-exclusive-group-how-can-i-set-a-default-value

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.

2. I tried to subscribe to Python-ideas python-ideas@python.org, but I
can't login to
https://mail.python.org/mailman3/lists/python-ideas.python.org/. Although I
did login to https://mail.python.org/mailman/options/python-list . Do I
have to create a new account?

Thanks,
Uri.
אורי
uri@speedy.net

Subject: Re: A new feature request - parser add_mutually_exclusive_group - add a default value
From: Paul Rubin
Newsgroups: comp.lang.python
Organization: A noiseless patient Spider
Date: Tue, 9 Jul 2024 06:04 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: no.email@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.python
Subject: Re: A new feature request - parser add_mutually_exclusive_group - add a default value
Date: Mon, 08 Jul 2024 23:04:14 -0700
Organization: A noiseless patient Spider
Lines: 6
Message-ID: <87wmlvnlsx.fsf@nightsong.com>
References: <CABD5YeHvY8GkzDcKkc1cEzHKkAEcHcLYpQ_-WLpuCC-Df4WFZw@mail.gmail.com>
<mailman.25.1720502024.2981.python-list@python.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Tue, 09 Jul 2024 08:04:14 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="92009af9ec77aa1fb154a8ea0268cbea";
logging-data="1354440"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/eAHGEWttTYJ5DoaXyVgTe"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:ZERdCEtt/S6cpb9vCHUNs1z2xoM=
sha1:FvjJgj6ii4JRjTinPzhhs3TnpHE=
View all headers

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.

Subject: Re: A new feature request - parser add_mutually_exclusive_group - add a default value
From: Stefan Ram
Newsgroups: comp.lang.python
Organization: Stefan Ram
Date: Tue, 9 Jul 2024 06:12 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: A new feature request - parser add_mutually_exclusive_group - add a default value
Date: 9 Jul 2024 06:12:53 GMT
Organization: Stefan Ram
Lines: 18
Expires: 1 Feb 2025 11:59:58 GMT
Message-ID: <parser-20240709071158@ram.dialup.fu-berlin.de>
References: <mailman.25.1720502024.2981.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de aEOF12xog56yQuW90KWHHAwA5E7Gj/2OWVvkGNHUoIhXH+
Cancel-Lock: sha1:ipRq296Gr5nrZsDkJ4MM7Lb4KX8= sha256:o+meY0fDm5FGb4EaYpHoOClEUQ/Krk/IMnrCvyNssLw=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
View all headers

=?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!

1

rocksolid light 0.9.8
clearnet tor