We have the following.

    >>> 12 = True
    SyntaxError: can't assign to literal

    >>> True = False
    SyntaxError: can't assign to keyword

    >>> ... = False
    SyntaxError: can't assign to Ellipsis

We also have (works better in monospaced font)

    >>> d[] = True
        d[] = True
          ^
    SyntaxError: invalid syntax

Beginners might appreciate having instead as error messages:

    SyntaxError: can't assign to literal: 12
    SyntaxError: can't assign to keyword: True
    SyntaxError: can't assign to literal: ...

-- 
Jonathan
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/4SHBUENP7TAMXZVN6VK26I6MXWXFBKJM/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to