name for a mutually inclusive relationship

Avi Gross avigross at verizon.net
Thu Feb 25 00:04:51 EST 2021


Is there a more general idea here? How about asking for a control that
internally manages N items and requires exactly M of them before the entry
is accepted when you click? The case being discussed sort of wants N out of
N, or nothing.

Example, you order a family dinner from a Restaurant and are told that for a
fixed price, you must order exactly 4 items from column A and another 5 from
column B.

Now linking the two is a bit much but if there are ten items in column A,
the only valid choices might be to not order at all or pick exactly 4.
Picking your first item would be easy and picking your second and third too.
Once you have 4, the setup should sort of lock so you cannot add more. But
if you unclick one, you should be able to select another. To get out of the
setup you either stop at exactly 4 or cancel out.

The problem with the N out of N case is that it is all or none. Unclicking
anything in this case may not be enough and perhaps the code should clear
all other items too. Clicking on any one, should mark all of them. So not
really a simple subset of the cases.

And what messages does a user get as they use the control?




-----Original Message-----
From: Python-list <python-list-bounces+avigross=verizon.net at python.org> On
Behalf Of Ethan Furman
Sent: Wednesday, February 24, 2021 5:14 PM
To: python-list at python.org
Subject: Re: name for a mutually inclusive relationship

On 2/24/21 1:54 PM, 2QdxY4RzWzUUiLuE at potatochowder.com wrote:
> Ethan Furman wrote:

>> I didn't say it was a good example.  ;-)  Hopefully it gets the idea
across.
> 
> Ditto.  ;-)
> 
> IMO, the whole idea of "my program has two options, and the user has 
> to specify both or neither," isn't a question of whether or not the 
> argument parsing library supports it, but a question of whether or not 
> it's a good API.

Like I said, at this moment I don't have a good example, only an awareness
that such a thing could exist and I don't know the name for it (if it has
one).

So far I have seen that there are even fewer good use-cases than I might
have guessed, and that no one seems to have a name for the general idea.

--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list