Lo definirei un confronto n-ario .
Gli operatori che lavorano su numeri arbitrari di operandi sono chiamati "n-ary" operatori :
n-ary
From a mathematical point of view, a function of n arguments can always be considered as a function of one single argument which is an element of some product space. However, it may be convenient for notation to consider n-ary functions, ...
The same is true for programming languages, where functions taking several arguments could always be defined as functions taking a single argument of some composite type such as a tuple, or in languages with higher-order functions, by currying.
- Binary means 2-ary.
- ...
- n-ary means n operands (or parameters), but is often used as a synonym of "polyadic".
Python ha un operatore n-ary <
. La sezione 5.6 dei documenti di lingua dice:
Unlike C, all comparison operations in Python have the same priority, which is lower than that of any arithmetic, shifting or bitwise operation. Also unlike C, expressions like a < b < c
have the interpretation that is conventional in mathematics:
Formally, if a
, b
, c
, ..., y
, z
are expressions and op1, op2, ..., opN are comparison operators, then a
op1 b
op2 c
... y
opN z
is equivalent to a
op1 b
and
b
op2 c
and
... y
opN z
, except that each expression is evaluated at most once.