[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020年6月23日 18:51:32 -0700

On 2020年06月24日 01:09, Guido van Rossum wrote:
On Tue, Jun 23, 2020 at 4:41 PM MRAB <[email protected] <mailto:[email protected]>> wrote:
[snip]
 However, what if you wanted to match Ellipsis?
 This could lead to bugs:
 >>> ...
 Ellipsis
 >>> Ellipsis = 0
 >>> Ellipsis
 0
 >>> ...
 Ellipsis
Now you're just being silly. If you want to use Ellipsis as a variable you can't also use it to refer to the "..." token.
[snip]
The point here is that printing ... shows "Ellipsis" (not "..."), printing None shows "None", etc. Printing Ellipsis also shows "Ellipsis", but you can bind to it. You can't bind to None, etc.
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/UZCECU4MCYBCI7EOZQM522ZCOZEKVHIX/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to