[issue43797] Improve syntax error for invalid comparisons

Serhiy Storchaka report at bugs.python.org
Sat Apr 10 04:31:22 EDT 2021


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

I tried to add

    | a=NAME '=' {
        RAISE_SYNTAX_ERROR_KNOWN_LOCATION(
            a, "invalid syntax. Maybe you meant '==' or ':=' instead of '='?") }
    | a=bitwise_or '=' {
        RAISE_SYNTAX_ERROR_KNOWN_LOCATION(
            a, "invalid syntax. Maybe you meant '==' instead of '='?") }

in invalid_named_expression, but it does not have any effect.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43797>
_______________________________________


More information about the Python-bugs-list mailing list