Nick Coghlan <ncogh...@gmail.com> added the comment: If we do decide to do this, I'm inclined to eventually make the change at the Grammar level rather than the AST level.
Current: comparison: expr (comp_op expr)* comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' Future: comparison: expr (comp_op expr)* | (containment_check) comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'is'|'is' 'not' containment_check: ('in'|'not' 'in') expr However, we'd still need an intermediate step like your PR in order to emit SyntaxWarning while still retaining the current semantics. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32055> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com