mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
cmp_type(): The grammar stopped allowing '=' as a comparison operator
about a decade ago. Put the code still allowing for it in cmp_type() out of its lonely misery.
This commit is contained in:
parent
d2eadc6946
commit
12d55a7caa
1 changed files with 2 additions and 3 deletions
|
@ -2368,15 +2368,14 @@ static enum cmp_op
|
||||||
cmp_type(node *n)
|
cmp_type(node *n)
|
||||||
{
|
{
|
||||||
REQ(n, comp_op);
|
REQ(n, comp_op);
|
||||||
/* comp_op: '<' | '>' | '=' | '>=' | '<=' | '<>' | '!=' | '=='
|
/* comp_op: '<' | '>' | '>=' | '<=' | '<>' | '!=' | '=='
|
||||||
| 'in' | 'not' 'in' | 'is' | 'is' not' */
|
| 'in' | 'not' 'in' | 'is' | 'is' not' */
|
||||||
if (NCH(n) == 1) {
|
if (NCH(n) == 1) {
|
||||||
n = CHILD(n, 0);
|
n = CHILD(n, 0);
|
||||||
switch (TYPE(n)) {
|
switch (TYPE(n)) {
|
||||||
case LESS: return PyCmp_LT;
|
case LESS: return PyCmp_LT;
|
||||||
case GREATER: return PyCmp_GT;
|
case GREATER: return PyCmp_GT;
|
||||||
case EQEQUAL: /* == */
|
case EQEQUAL: return PyCmp_EQ;
|
||||||
case EQUAL: return PyCmp_EQ;
|
|
||||||
case LESSEQUAL: return PyCmp_LE;
|
case LESSEQUAL: return PyCmp_LE;
|
||||||
case GREATEREQUAL: return PyCmp_GE;
|
case GREATEREQUAL: return PyCmp_GE;
|
||||||
case NOTEQUAL: return PyCmp_NE; /* <> or != */
|
case NOTEQUAL: return PyCmp_NE; /* <> or != */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue