Sujet : Re: Interval Comparisons
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.cDate : 05. Jun 2024, 02:30:57
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v3of4h$pbb1$1@dont-email.me>
References : 1 2 3 4
User-Agent : Pan/0.158 (Avdiivka; )
On Wed, 5 Jun 2024 00:22:36 +0100, bart wrote:
On 05/06/2024 00:12, Lawrence D'Oliveiro wrote:
>
On Tue, 4 Jun 2024 11:41:54 -0000 (UTC), Blue-Maned_Hawk wrote:
i think that we need not worsen the matter with new ternary operators.
These are not ternary operators.
So what are they?
A special case in the syntax rules for the comparison operators
<
https://docs.python.org/3/reference/expressions.html#comparisons>.
I've implemented them several times, and found they really need to be
treated as a special kind of n-ary opterator.
Remember, Python allows users to define custom overloads for the standard
operators. For comparisons, these functions always take two operands, and
the compiler takes care of invoking them correctly to handle interval
comparisons.