On Mon, 2021-05-31 at 11:37 -0300, André Roberge wrote:
> In Python `...` is referred to as `Ellipsis` and cannot be assigned to. 
> Yet, one can assign any value to the name `Ellipsis`.
> 
> Consider the following:
> 
> ```
> > > > ...
> Ellipsis
> > > > ... == Ellipsis
> True
> > > > Ellipsis
> Ellipsis
> > > > Ellipsis = 3
> > > > Ellipsis
> 3
> > > > ... = 4
>   File "<stdin>", line 1
>     ... = 4
>     ^
> SyntaxError: cannot assign to Ellipsis
> > > >   # But I just did assign a new value to the name Ellipsis above.
> > > > Ellipsis
> 3    
> > > > ...
> Ellipsis
> > > > ... == Ellipsis
> False
> ```
> 
> For consistency, `Ellipsis` (the name) should **always** refer to the same
> object that `...` refers to, so that both could not be assigned a new value.
> 

Perhaps Ellipsis could get the same treatment as None here, but I am not sure if
there's enough reasoning to justify that, especially considering that it would
be a backwards incompatible change.

Do you have any use-cases that would warrant such a thing? I find it incredibly
hard to justify this proposal.

Cheers,
Filipe Laíns

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
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/EKTS6HI6DQAJUPKQZ4X7ODCBTKQ5PBLJ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to