Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 12d55a7

Browse files
committed
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.
1 parent d2eadc6 commit 12d55a7

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Python/compile.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2368,15 +2368,14 @@ static enum cmp_op
23682368
cmp_type(node *n)
23692369
{
23702370
REQ(n, comp_op);
2371-
/* comp_op: '<' | '>' | '=' | '>=' | '<=' | '<>' | '!=' | '=='
2371+
/* comp_op: '<' | '>' | '>=' | '<=' | '<>' | '!=' | '=='
23722372
| 'in' | 'not' 'in' | 'is' | 'is' not' */
23732373
if (NCH(n) == 1) {
23742374
n = CHILD(n, 0);
23752375
switch (TYPE(n)) {
23762376
case LESS: return PyCmp_LT;
23772377
case GREATER: return PyCmp_GT;
2378-
case EQEQUAL: /* == */
2379-
case EQUAL: return PyCmp_EQ;
2378+
case EQEQUAL: return PyCmp_EQ;
23802379
case LESSEQUAL: return PyCmp_LE;
23812380
case GREATEREQUAL: return PyCmp_GE;
23822381
case NOTEQUAL: return PyCmp_NE; /* <> or != */

0 commit comments

Comments
 (0)