On 2021-05-31 12:46, Chris Angelico wrote:
On Tue, Jun 1, 2021 at 5:40 AM David Mertz <me...@gnosis.cx> wrote:

I think making 'Ellipsis' a reserved word is too much.  The analogy with 
non-reserved words like `int`, `str`, `map`, `print`, and so on, illustrate 
this, I think.  I.e. redefining those is likely to cause bad things to happen, 
but we're consenting adults, and in the end they are just names.

However, I think improving the repr() of the Ellipsis object itself to remind 
users of the connection with its special literal `...` is a great idea.


Originally, the notation "..." could only be used inside a subscript,
and anywhere else, you'd have to spell it "Ellipsis". Now that you can
use "..." anywhere, would it be worth switching the repr to just be
that?

I feel like that might be confusing. We do have things like lists where the repr of an empty list is [], but lists are pretty basic and ubiquitous Python objects that people usually learn about quite early. Ellipsis is a more obscure thing so it seems worthwhile to label it somehow rather than just giving a cryptic three dots.

--
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail."
   --author unknown
_______________________________________________
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/VLK2PL3EU3GFJRECHHKKNNDWGUSZXIZQ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to