On Tue, Jun 1, 2021 at 1:46 AM David Mertz <mertz@gnosis.cx> wrote:
On Mon, May 31, 2021 at 11:41 PM Steven D'Aprano <steve@pearwood.info> wrote:

 
Not every builtin needs a mollyguard to protect against misuse.

I'm not likely to rebind `Ellipsis` so that's not really my concern.  Rather, I'm interested in the point André Roberge started the thread with. 

Actually, the very first observation I made is that, if you try to assign a value to '...', the traceback includes the message:

SyntaxError: cannot assign to Ellipsis

which is clearly wrong. If it would state:

SyntaxError: cannot assign to '...'

the only inconsistency left would be a more minor one, that is of the repr of '...' stating that it is Ellipsis which can be incorrect if Ellipsis is bound to a different value.

Sorry for opening what became a rabbit hole of a discussion.

André


 
The repr of '...' should be more self-explanatory to beginners.  It's basically co-opting the square brackets or parenthesis to mean something that doesn't really have anything to do with calling or indexing in order to have a repr—in tracebacks specifically, but elsewhere also—that reminds users of the connection between `...` and `Ellipsis`.

--
The dead increasingly dominate and strangle both the living and the
not-yet born.  Vampiric capital and undead corporate persons abuse
the lives and control the thoughts of homo faber. Ideas, once born,
become abortifacients against new conceptions.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-leave@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/USE2ICT6CVRFNINM4S5O3FOWEO3ZSVUP/
Code of Conduct: http://python.org/psf/codeofconduct/